Преглед изворни кода

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();
     }
 
     /**