偏好';s onCreateView在Android中被多次调用
我有一个PreferenceScreen,其中包含很少的首选项对象。首选项屏幕内的第一个首选项是自定义首选项。现在的问题是,该自定义首选项的onCreateView()调用了多次。如果我更改首选项的顺序,那么它只会被调用一次。为什么会有这种行为 下面是我的xml文件。我正在PreferenceFragment中添加此首选项文件偏好';s onCreateView在Android中被多次调用,android,android-preferences,preferencescreen,Android,Android Preferences,Preferencescreen,我有一个PreferenceScreen,其中包含很少的首选项对象。首选项屏幕内的第一个首选项是自定义首选项。现在的问题是,该自定义首选项的onCreateView()调用了多次。如果我更改首选项的顺序,那么它只会被调用一次。为什么会有这种行为 下面是我的xml文件。我正在PreferenceFragment中添加此首选项文件 <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
<com.android.view.CustomPreference
android:key="pref0" />
<Preference
android:key="pref1"
android:layout="@layout/preferences_row_view" />
<Preference
android:key="pref2"
android:layout="@layout/preferences_row_view" />
<Preference
android:key="pref3"
android:layout="@layout/preferences_row_view" />
</PreferenceScreen>