📜  获取偏好值 android - Java 代码示例

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

代码示例2
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