Hello, I need to know how to set a value programmatically.
I am using this code
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); . . . SharedPreferences.Editor geted = prefs.edit(); geted.putBoolean("checkBox_Schedule", false); geted.commit();
But I don't see anything change
My xml code for my checkboxPreference
<CheckBoxPreference android:defaultValue="false" android:dependency="checkBox" android:key="checkBox_Schedule" android:summary="On/Off" android:title="Schedule" />
One solution is
startActivity(new Intent(SetPreference.this, SetPreference.class));
But that is not what I want to do.
source share