android - SharedPreferences, PreferenceActivity problem -
i have in settings.xml 2 checkboxes. each checkboxes has same keys "showcontactphotoscheckboxpref":
<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" /> </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> after start app state of chekbox №1 = chekbox №2 = true. when click on chekbox №1(state unchecked) , go checkbox №2 - state checked, in sharedpreferences file state of showcontactphotoscheckboxpref false. possible synchronize these chekboxes?
naming 2 keys same in different preferencescreens doesn't mean same key. in fact practice use unique key names. either use single checkboxpreference or update settings each of 2 preferences programmatically when checked/unchecked.
Comments
Post a Comment