Переглянути джерело

use apply instead of commit

AndyScherzinger 8 роки тому
батько
коміт
9021848af6

+ 1 - 1
src/main/java/com/owncloud/android/authentication/AccountUtils.java

@@ -156,7 +156,7 @@ public class AccountUtils {
                             .getDefaultSharedPreferences(context).edit();
                     appPrefs.putString("select_oc_account", accountName);
     
-                    appPrefs.commit();
+                    appPrefs.apply();
                     result = true;
                     break;
                 }

+ 1 - 1
src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java

@@ -1791,7 +1791,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
                 SharedPreferences.Editor editor = PreferenceManager
                         .getDefaultSharedPreferences(this).edit();
                 editor.putString("select_oc_account", accountName);
-                editor.commit();
+                editor.apply();
             }
 
             /// prepare result to return to the Authenticator

+ 1 - 1
src/main/java/com/owncloud/android/db/PreferenceManager.java

@@ -274,7 +274,7 @@ public abstract class PreferenceManager {
     private static void saveStringPreferenceNow(Context context, String key, String value) {
         SharedPreferences.Editor appPreferences = getDefaultSharedPreferences(context.getApplicationContext()).edit();
         appPreferences.putString(key, value);
-        appPreferences.commit();
+        appPreferences.apply();
     }
 
     private static void saveIntPreference(Context context, String key, int value) {