Browse Source

Androind: Lint warning, use "apply()" instead of "commit()"
'Consider using apply() instead; commit writes its data to persistent storage immediately, whereas apply will handle it in the background'

Sylvain 2 days ago
parent
commit
8da1021b51

+ 2 - 2
android-project/app/src/main/java/org/libsdl/app/HIDDeviceManager.java

@@ -113,7 +113,7 @@ public class HIDDeviceManager {
 //        if (shouldClear) {
 //            SharedPreferences.Editor spedit = mSharedPreferences.edit();
 //            spedit.clear();
-//            spedit.commit();
+//            spedit.apply();
 //        }
 //        else
         {
@@ -135,7 +135,7 @@ public class HIDDeviceManager {
         }
 
         spedit.putInt(identifier, result);
-        spedit.commit();
+        spedit.apply();
         return result;
     }