3
我的应用程序连接到使用OAuth授权的服务器。 我应该如何在帐户管理器中存储这些帐户? 万一我已经登录并通过,它可以像下面:AccountManager和OAuth - 如何添加帐户?
Account account = new Account("user1", context.getString(R.string.ACCOUNT_TYPE));
AccountManager am = AccountManager.get(context);
if (am.addAccountExplicitly(account, "pass1", null)) {
result = new Bundle();
Log.i(TAG, "account: "+account.name+", "+account.type);
result.putString(AccountManager.KEY_ACCOUNT_NAME, account.name);
result.putString(AccountManager.KEY_ACCOUNT_TYPE, account.type);
activity.setAccountAuthenticatorResult(result);
但是应该传递,而不是用户名和传递OAuth的帐户的情况下? 我应该在哪里存储OAuth秘密? OAuth令牌应该存储在KEY_AUTHTOKEN中?