【发布时间】:2017-07-16 16:33:15
【问题描述】:
我根据文档创建了一个自定义帐户,我有一个扩展 AbstractAccountAuthenticator 和服务的类。
我添加一个这样的帐户:
public static void addCustomAccount(Context context, String title, String password) {
AccountManager accountManager = AccountManager.get(context);
Account account = new Account(title, Constants.ACCOUNT_KEY);
if (accountManager.addAccountExplicitly(account, password, null)) {
Log.v(Constants.LOGTAG, "Account in Android Accounts was created");
}
}
一切正常,帐户显示在设置中。
我的问题是:
如何找回我在此过程中设置的密码?
【问题讨论】:
-
@cricket_007 抱歉打错了
-
@cricket_007 哎呀,我什至不能复制粘贴。现在应该好了...
-
AccountManager 类中有几个方法是“getAccounts”。你试过了吗?
-
@cricket_007 ofc。但是,如果我获得了我添加的正确帐户(这有效)
account对象没有字段或方法来检索密码