📜  android sharedpreferences - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:27.184000             🧑  作者: Mango

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