The settings file contains a nested PreferenceScreen , which includes two categories of 2 parameters from the external library Android Color Picker and a call to the dialog in which I delete the values of the settings to return to the default settings. The question is - how to update the internal PreferenceScreen to show the changed settings? After closing the settings dialog, the color does not change to default.
settings code:
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" android:key="key_pref_preference_screen"> <PreferenceCategory android:title="@string/pref_category_db"> <qqq.qqq.settings.MyPreferenceDialog android:key="pref_key_clear_learn" android:summary="@string/pref_description_clear_learn" android:title="@string/pref_title_clear_learn"> </qqq.qqq.settings.MyPreferenceDialog> </PreferenceCategory> <PreferenceCategory android:title="@string/pref_category_rest"> <CheckBoxPreference android:defaultValue="true" android:key="pref_key_check_animation" android:summary="@string/pref_check_animation_summary" android:title="@string/pref_check_animation_title" /> </PreferenceCategory> <PreferenceScreen android:key="key_pref_custom_inter" android:summary="@string/pref_custom_inter_summary" android:title="@string/pref_title_custom_inter"> <PreferenceCategory android:title="@string/pref_title_custom_inter_buttons"> <yuku.ambilwarna.widget.AmbilWarnaPreference android:defaultValue="@color/color_inter_color_font_button" android:key="key_pref_custom_inter_color_font_button" android:summary="@string/pref_custom_inter_color_font_button_summary" android:title="@string/pref_custom_inter_color_font_button_title" /> <yuku.ambilwarna.widget.AmbilWarnaPreference android:defaultValue="@color/color_inter_color_background_button" android:key="key_pref_custom_inter_color_background_button" android:summary="@string/pref_custom_inter_color_background_button_summary" android:title="@string/pref_custom_inter_color_background_button_title" /> </PreferenceCategory> <PreferenceCategory android:title="@string/pref_title_custom_inter_show"> <yuku.ambilwarna.widget.AmbilWarnaPreference android:defaultValue="@color/color_inter_color_font" android:key="key_pref_custom_inter_color_font" android:summary="@string/pref_custom_inter_color_font_summary" android:title="@string/pref_custom_inter_color_font_title" /> <yuku.ambilwarna.widget.AmbilWarnaPreference android:defaultValue="@color/color_inter_color_background" android:key="key_pref_custom_inter_color_background" android:summary="@string/pref_custom_inter_color_background_summary" android:title="@string/pref_custom_inter_color_background_title" /> </PreferenceCategory> <qqq.qqq.settings.MyPreferenceDialog android:defaultValue="false" android:key="pref_key_clear_custom_inter" android:summary="@string/pref_clear_custom_inter_summary" android:title="@string/pref_title_clear_custom_inter"> </qqq.qqq.settings.MyPreferenceDialog> </PreferenceScreen> </PreferenceScreen>
recreate()call and it did not help? - Yuriy SPb ♦setPreferenceScreen(null); addPreferencesFromResource(R.xml.preferences);I tried it here, if there is no nested PreferenceScreen, then the result works and it suits me, but it doesn't work with the nested one - Maxim Fomichev