如何找到与Android市场相关的Gmail帐户? [英] How to find Gmail account associated with Android Market?
问题描述
我知道如何找到账户(其中包括用户的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).
感谢您的帮助。
推荐答案
对话框
时,造成的<一个实施href="http://developer.android.com/reference/android/accounts/AbstractAccountAuthenticator.html#getAccountRemovalAllowed%28android.accounts.AccountAuthenticatorResponse,%20android.accounts.Account%29"相对=nofollow> 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.
这篇关于如何找到与Android市场相关的Gmail帐户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!