Hi, guys!
I have PreferemceActivity inflated from xml:
One of the preferences(checkbox) change state of other checkbox:
But when I go to screen with ShowContactPhotosCheckBoxPref it still hold previous preference value...
How can I tell PreferenceActivity to refresh its value?
I have PreferemceActivity inflated from xml:
Code:
<PreferenceScreen
android:title="Appearence"
android:key="AppearencePref" >
......
<PreferenceCategory
android:title="Show Contact Photos">
<CheckBoxPreference
android:title="Show Contact Photos"
android:summary="@string/show_contact_photos_preference"
android:defaultValue="true"
android:key="ShowContactPhotosCheckBoxPref_Appendix" />
</PreferenceCategory>
........
</PreferenceScreen>
.......
<PreferenceScreen
android:title="Contact Options"
android:key="ContactOtionsPref">
<PreferenceCategory
android:title="Show Contact Photos">
<CheckBoxPreference
android:title="Show Contact Photos"
android:defaultValue="true"
android:key="ShowContactPhotosCheckBoxPref" />
</PreferenceCategory>
......
</PreferenceScreen>
Code:
if("ShowContactPhotosCheckBoxPref_Appendix".equals(key)){
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mContext);
boolean isChecked = prefs.getBoolean("ShowContactPhotosCheckBoxPref_Appendix", false);
Editor editor = PreferenceManager.getDefaultSharedPreferences(mContext).edit();
editor.putBoolean("ShowContactPhotosCheckBoxPref", isChecked);
editor.commit();
}
How can I tell PreferenceActivity to refresh its value?