瀏覽代碼

Prefer Editor#apply over commit

Sebastián Katzer 11 年之前
父節點
當前提交
4341434978
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      src/android/LocalNotification.java

+ 3 - 3
src/android/LocalNotification.java

@@ -247,7 +247,7 @@ public class LocalNotification extends CordovaPlugin {
 
         if (alarmId != null) {
             editor.putString(alarmId, args.toString());
-            editor.commit();
+            editor.apply();
         }
     }
 
@@ -262,7 +262,7 @@ public class LocalNotification extends CordovaPlugin {
 
         if (alarmId != null) {
             editor.remove(alarmId);
-            editor.commit();
+            editor.apply();
         }
     }
 
@@ -273,7 +273,7 @@ public class LocalNotification extends CordovaPlugin {
         Editor editor = getSharedPreferences().edit();
 
         editor.clear();
-        editor.commit();
+        editor.apply();
     }
 
     /**