瀏覽代碼

delete accounts only on first start

tobiasKaminsky 7 年之前
父節點
當前提交
3ef66ea824
共有 1 個文件被更改,包括 5 次插入3 次删除
  1. 5 3
      src/main/java/com/owncloud/android/ui/activity/WhatsNewActivity.java

+ 5 - 3
src/main/java/com/owncloud/android/ui/activity/WhatsNewActivity.java

@@ -83,9 +83,11 @@ public class WhatsNewActivity extends FragmentActivity implements ViewPager.OnPa
         String[] urls = getResources().getStringArray(R.array.whatsnew_urls);
 
         // Sometimes, accounts are not deleted when you uninstall the application so we'll do it now
-        AccountManager am = (AccountManager) getSystemService(ACCOUNT_SERVICE);
-        for (Account account : AccountUtils.getAccounts(this)) {
-            am.removeAccount(account, null, null);
+        if (isFirstRun()) {
+            AccountManager am = (AccountManager) getSystemService(ACCOUNT_SERVICE);
+            for (Account account : AccountUtils.getAccounts(this)) {
+                am.removeAccount(account, null, null);
+            }
         }
 
         boolean showWebView = urls.length > 0;