代码之家  ›  专栏  ›  技术社区  ›  Sebastian Schneider

Android自定义帐户检索密码

  •  0
  • Sebastian Schneider  · 技术社区  · 9 年前

    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");
            }
        }
    

    我的问题是:

    如何检索在此过程中设置的密码?

    1 回复  |  直到 9 年前
        1
  •  1
  •   OneCricketeer Gabriele Mariotti    9 年前

    看起来像 AccountManager#getPassword(Account account)

    您可以通过 getAccounts 管理者的方法