如何在android中将AbstractAccountAuthenticator与AccountAuthenticatorActivity链接
官方文档说要在addAccount方法中返回一个bundle。这是干什么用的如何在android中将AbstractAccountAuthenticator与AccountAuthenticatorActivity链接,android,Android,官方文档说要在addAccount方法中返回一个bundle。这是干什么用的 @Override public Bundle addAccount(AccountAuthenticatorResponse response, String accountType, String authTokenType, String[] requiredFeatures, Bundle options) throws NetworkErrorException { Log.v("TAG", "ad
@Override
public Bundle addAccount(AccountAuthenticatorResponse response, String accountType, String authTokenType, String[] requiredFeatures, Bundle options) throws NetworkErrorException {
Log.v("TAG", "addAccount()");
final Intent intent = new Intent(mContext, AuthenticatorActivity.class);
intent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE, response);
final Bundle bundle = new Bundle();
bundle.putParcelable(AccountManager.KEY_INTENT, intent);
return bundle;
}
我无法获取此AbstractAccountAuthenticator的实际工作流。我是否应该启动AccountAuthenticatorActivity作为启动器活动,并通过传递当前活动的上下文来调用AbstractAccountAuthenticator?如果是,何时调用addAccount方法?我应该在哪里调用API以在后端创建帐户?AbstractAccountAuthenticator将在哪里保存令牌?我应该如何从AbstractAccountAuthenticator访问该令牌?当用户尝试从设置添加帐户时调用它。当用户尝试从设置添加帐户时调用它