1boolean committed = PreferenceManager.getDefaultSharedPreferences(yourContext).edit().putBoolean(key, mValue).commit();
2//you can also use putInt, putFloat, putLong, putString, putStringSet and change the value of mValue
3//committed is true if everything went alright, false if there was an error