We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 12a8dc2 commit 6647210Copy full SHA for 6647210
1 file changed
utils/src/main/java/com/haoge/easyandroid/easy/EasySharedPreferences.kt
@@ -190,6 +190,13 @@ class EasySharedPreferences(clazz: Class<*>):SharedPreferences.OnSharedPreferenc
190
handler.apply { }
191
}
192
193
+ /**
194
+ * 将类中的数据同步到SP容器中去。(同步执行)
195
+ */
196
+ fun commit() {
197
+ write()
198
+ }
199
+
200
private fun getValid(value:String?, default:String):String =
201
if (value.isNullOrEmpty()) default else value as String
202
@@ -239,6 +246,10 @@ abstract class PreferenceSupport {
239
246
// 将当前类中的修改。同步到sp中去(任务运行于子线程)
240
247
EasySharedPreferences.find(javaClass).apply()
241
248
249
250
251
+ EasySharedPreferences.find(javaClass).commit()
252
242
253
243
254
244
255
@Retention(AnnotationRetention.RUNTIME)
0 commit comments