X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/ea14d6247ed1568064db5a22458d21a3167a48b3..5ca1b94865fcb868c44fe11df01ba17d33673b17:/src/com/owncloud/android/ui/activity/FileActivity.java diff --git a/src/com/owncloud/android/ui/activity/FileActivity.java b/src/com/owncloud/android/ui/activity/FileActivity.java index 43e11b13..8a5449e7 100644 --- a/src/com/owncloud/android/ui/activity/FileActivity.java +++ b/src/com/owncloud/android/ui/activity/FileActivity.java @@ -167,7 +167,17 @@ public class FileActivity extends SherlockFragmentActivity } - + + @Override + protected void onNewIntent (Intent intent) { + Log_OC.v(TAG, "onNewIntent() start"); + Account current = AccountUtils.getCurrentOwnCloudAccount(this); + if (current != null && mAccount != null && !mAccount.name.equals(current.name)) { + mAccount = current; + } + Log_OC.v(TAG, "onNewIntent() stop"); + } + /** * Since ownCloud {@link Account}s can be managed from the system setting menu, * the existence of the {@link Account} associated to the instance must be checked @@ -177,8 +187,7 @@ public class FileActivity extends SherlockFragmentActivity protected void onRestart() { Log_OC.v(TAG, "onRestart() start"); super.onRestart(); - boolean validAccount = - (mAccount != null && AccountUtils.setCurrentOwnCloudAccount(getApplicationContext(), mAccount.name)); + boolean validAccount = (mAccount != null && AccountUtils.exists(mAccount, this)); if (!validAccount) { swapToDefaultAccount(); } @@ -223,6 +232,7 @@ public class FileActivity extends SherlockFragmentActivity @Override protected void onDestroy() { + Log_OC.v(TAG, "onDestroy() start"); if (mOperationsServiceConnection != null) { unbindService(mOperationsServiceConnection); mOperationsServiceBinder = null; @@ -237,6 +247,7 @@ public class FileActivity extends SherlockFragmentActivity } super.onDestroy(); + Log_OC.v(TAG, "onDestroy() end"); }