/** * Sends the result or a Constants.ERROR_CODE_CANCELED error if a result isn't present. */ @Override public void finish() { if (accountAuthenticatorResponse != null) { // send the result bundle back if set, otherwise send an error. if (resultBundle != null) { accountAuthenticatorResponse.onResult(resultBundle); } else { accountAuthenticatorResponse.onError(AccountManager.ERROR_CODE_CANCELED, "canceled"); } accountAuthenticatorResponse = null; } super.finish(); } }
@Override public void finish() { if (mAccountAuthenticatorResponse != null) { // send the result bundle back if set, otherwise send an error. if (mResultBundle != null) { mAccountAuthenticatorResponse.onResult(mResultBundle); } else { mAccountAuthenticatorResponse.onError(AccountManager.ERROR_CODE_CANCELED, "canceled"); } mAccountAuthenticatorResponse = null; } super.finish(); }
Account account = new Account("John Doe", "com.myapp.account"); ContentResolver.setIsSyncable(account, ContactsContract.AUTHORITY, 0); AccountManager am = AccountManager.get(LoginActivity.this); boolean accountCreated = am.addAccountExplicitly(account, "Password", null); Bundle extras = LoginActivity.this.getIntent().getExtras(); if(extras != null){ if (accountCreated) { AccountAuthenticatorResponse response = extras.getParcelable(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE); Bundle result = new Bundle(); result.putString(AccountManager.KEY_ACCOUNT_NAME, "John Doe"); result.putString(AccountManager.KEY_ACCOUNT_TYPE, "com.myapp.account"); response.onResult(result); } }
/** Clean up the account authenticator stuff, see {@link AccountAuthenticatorActivity} */ @Override public void finish() { if (authenticatorResponse != null) { if (resultBundle != null) { authenticatorResponse.onResult(resultBundle); } else { authenticatorResponse.onError(AccountManager.ERROR_CODE_CANCELED, "canceled"); } authenticatorResponse = null; } super.finish(); }
/** * Sends the result or a Constants.ERROR_CODE_CANCELED error if a result isn't present. */ public void finish() { if (mAccountAuthenticatorResponse != null) { // send the result bundle back if set, otherwise send an error. if (mResultBundle != null) { mAccountAuthenticatorResponse.onResult(mResultBundle); } else { mAccountAuthenticatorResponse.onError(AccountManager.ERROR_CODE_CANCELED, "canceled"); } mAccountAuthenticatorResponse = null; } super.finish(); } }
/** * Sends the result or a GithubConstants.ERROR_CODE_CANCELED error if a result isn't present. */ @Override public void finish() { if (mAccountAuthenticatorResponse != null) { // send the result bundle back if set, otherwise send an error. if (mResultBundle != null) { mAccountAuthenticatorResponse.onResult(mResultBundle); } else { mAccountAuthenticatorResponse.onError(AccountManager.ERROR_CODE_CANCELED, "canceled"); } mAccountAuthenticatorResponse = null; } super.finish(); }
/** * Sends the result or a Constants.ERROR_CODE_CANCELED error if a result isn't present. */ public void finish() { if (mAccountAuthenticatorResponse != null) { // send the result bundle back if set, otherwise send an error. if (mResultBundle != null) { mAccountAuthenticatorResponse.onResult(mResultBundle); } else { mAccountAuthenticatorResponse.onError(AccountManager.ERROR_CODE_CANCELED, "canceled"); } mAccountAuthenticatorResponse = null; } super.finish(); } }
/** * Sends the result or a Constants.ERROR_CODE_CANCELED error if a result isn't present. */ public void finish() { if (mAccountAuthenticatorResponse != null) { // send the result bundle back if set, otherwise send an error. if (mResultBundle != null) { mAccountAuthenticatorResponse.onResult(mResultBundle); } else { mAccountAuthenticatorResponse.onError(AccountManager.ERROR_CODE_CANCELED, "canceled"); } mAccountAuthenticatorResponse = null; } super.finish(); }
/** * Sends the result or a Constants.ERROR_CODE_CANCELED error if a result isn't present. */ @Override public void finish() { if (mAccountAuthenticatorResponse != null) { // send the result bundle back if set, otherwise send an error. if (mResultBundle != null) { mAccountAuthenticatorResponse.onResult(mResultBundle); } else { mAccountAuthenticatorResponse.onError(AccountManager.ERROR_CODE_CANCELED, "canceled"); } mAccountAuthenticatorResponse = null; } super.finish(); } }
result.putString(AccountManager.KEY_ACCOUNT_TYPE, AuthenticatorService.ANDROID_ACCOUNT_TYPE); state.authenticatorResponse.onResult(result); message += "authenticatorResponse; account.name=" + state.getAccount().getAccountName() + "; ";