Эх сурвалжийг харах

Prefer Editor#apply over commit

Sebastián Katzer 11 жил өмнө
parent
commit
4341434978

+ 3 - 3
src/android/LocalNotification.java

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