如何找到与Android市场相关的Gmail帐户?帐户、市场、Android、Gmail

2023-09-12 10:31:11 作者:神经病医院八号床

我知道如何找到账户(其中包括用户的Gmail电子邮件IDS)以及如何过滤的Gmail帐户。

I know how to find accounts (which will include gmail email ids of user) and how to filter gmail account.

AccountManager am = AccountManager.get(context);
        Account[] accounts = am.getAccounts();
        ArrayList<String> googleAccounts = new ArrayList<String>();
        for (Account ac : accounts) {
            String acname = ac.name;
            String actype = ac.type;
            //add only google accounts
            if(ac.type.equals("com.google")) {
                googleAccounts.add(ac.name);
            }
            Log.d(TAG, "accountInfo: " + acname + ":" + actype);
        }
        return googleAccounts;

我想知道的是如何找到与Android市场相关联的Gmail帐户?如果你会尝试删除Android手机Gmail帐户,您将收到此消息

What I wish to know is how to find the gmail account associated with Android Market? If you will try to delete a gmail account from Android phone you will get this message

但如果你试图删除与Android市场相关联的Gmail帐户您将收到以下消息(如果preSS 删除帐户早前消息)。

but if you try to delete a gmail account associated with Android Market you will get the following message (if you press remove account in the earlier message).

感谢您的帮助。

推荐答案

对话框

时,造成的 AbstractAccountAuthenticator#getAccountRemovalAllowed 在谷歌帐户身份验证。

is caused by the implementation of AbstractAccountAuthenticator#getAccountRemovalAllowed in the Google account authenticator.

由于调用 AbstractAccountAuthenticator 的实现是直接由系统只允许pvented $ P $ android.permission.ACCOUNT_MANAGER 你将有一个很难发现这一点你自己了。

Since calling implementations of AbstractAccountAuthenticator directly is prevented by the system-only permission android.permission.ACCOUNT_MANAGER you're going to have a hard time finding this out on your own.