Browse Source

Merge pull request #1676 from nextcloud/200wn

Delete accounts only on first start
Andy Scherzinger 7 years ago
parent
commit
eb8e0b1565

+ 1 - 1
scripts/lint/lint-results.txt

@@ -1,2 +1,2 @@
 DO NOT TOUCH; GENERATED BY DRONE
 DO NOT TOUCH; GENERATED BY DRONE
-      <span class="mdl-layout-title">Lint Report: 1 error and 515 warnings</span>
+      <span class="mdl-layout-title">Lint Report: 511 warnings</span>

+ 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);
         String[] urls = getResources().getStringArray(R.array.whatsnew_urls);
 
 
         // Sometimes, accounts are not deleted when you uninstall the application so we'll do it now
         // 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;
         boolean showWebView = urls.length > 0;