From: masensio Date: Tue, 20 Aug 2013 09:02:17 +0000 (+0200) Subject: refresh account when session expires X-Git-Tag: oc-android-1.4.6~17^2~17 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/31e83e17e4a0a609d9159f1faba375c0c0aa05d6?ds=sidebyside refresh account when session expires --- diff --git a/src/com/owncloud/android/authentication/AuthenticatorActivity.java b/src/com/owncloud/android/authentication/AuthenticatorActivity.java index a768821a..2387ad1e 100644 --- a/src/com/owncloud/android/authentication/AuthenticatorActivity.java +++ b/src/com/owncloud/android/authentication/AuthenticatorActivity.java @@ -1146,6 +1146,9 @@ implements OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList mAccountMgr.setPassword(mAccount, mPasswordInput.getText().toString()); } setAccountAuthenticatorResult(response); + + // Sync Account + syncAccount(); } @@ -1213,9 +1216,10 @@ implements OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList setResult(RESULT_OK, intent); /// immediately request for the synchronization of the new account - Bundle bundle = new Bundle(); - bundle.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true); - ContentResolver.requestSync(mAccount, AccountAuthenticator.AUTHORITY, bundle); + syncAccount(); +// Bundle bundle = new Bundle(); +// bundle.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true); +// ContentResolver.requestSync(mAccount, AccountAuthenticator.AUTHORITY, bundle); } @@ -1560,4 +1564,11 @@ implements OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList mAuthMessage.setVisibility(View.GONE); } + + private void syncAccount(){ + /// immediately request for the synchronization of the new account + Bundle bundle = new Bundle(); + bundle.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true); + ContentResolver.requestSync(mAccount, AccountAuthenticator.AUTHORITY, bundle); + } }