How to find Gmail account associated with Android Market?(如何找到与 Android Market 关联的 Gmail 帐户?)
问题描述
我知道如何查找帐户(包括用户的 gmail 电子邮件 ID)以及如何过滤 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 Market 关联的 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 Market 关联的 gmail 帐户,您将收到以下消息(如果您在之前的消息中按 删除帐户).
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 在 Google 帐户验证器中.
is caused by the implementation of AbstractAccountAuthenticator#getAccountRemovalAllowed in the Google account authenticator.
由于 AbstractAccountAuthenticator
的调用实现直接被系统权限 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 Market 关联的 Gmail 帐户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何找到与 Android Market 关联的 Gmail 帐户?
基础教程推荐
- 如何在没有IB的情况下将2个按钮添加到右侧的UINavigationbar? 2022-01-01
- 如何让对象对 Cocos2D 中的触摸做出反应? 2022-01-01
- 当从同一个组件调用时,两个 IBAction 触发的顺序是什么? 2022-01-01
- android 应用程序已发布,但在 google play 中找不到 2022-01-01
- Kivy Buildozer 无法构建 apk,命令失败:./distribute.sh -m “kivy"d 2022-01-01
- 如何在 UIImageView 中异步加载图像? 2022-01-01
- 如何在 iPhone 上显示来自 API 的 HTML 文本? 2022-01-01
- UIWebView 委托方法 shouldStartLoadWithRequest:在 WKWebView 中等效? 2022-01-01
- Android:对话框关闭而不调用关闭 2022-01-01
- 在 gmail 中为 ios 应用程序检索朋友的朋友 2022-01-01