I use CheckBoxPreference in my PreferenceActivity to set a value. Later on, I want to check that value from Receiver and/or Service. findPreference() method is not available from that context. I know, that this preference value is stored in SharedPreferences anyway, but what is the key? How could I get the value of the checkbox?
I use CheckBoxPreference in my PreferenceActivity to set a value. Later on, I want
Share
Whatever value you have for
android:keyin your preference XML.Call
PreferenceManager.getDefaultSharedPreferences()to get theSharedPreferences, then callgetBoolean()with the key you used inandroid:key.