如何找到与 Android Market 关联的 Gmail 帐户?

2023-11-09移动开发问题
2

本文介绍了如何找到与 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 帐户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

从 Documents 目录存储和读取文件 iOS 5
Storing and reading files from Documents directory iOS 5(从 Documents 目录存储和读取文件 iOS 5)...
2024-08-12 移动开发问题
9

如何在使用 cocos2d 的 iphone 应用程序中使用 MYSQL 数据库连接?
How can i use MYSQL database connection in iphone application useing cocos2d?(如何在使用 cocos2d 的 iphone 应用程序中使用 MYSQL 数据库连接?)...
2024-08-12 移动开发问题
5

在 cocos2d 中平滑拖动一个 Sprite - iPhone
Smoothly drag a Sprite in cocos2d - iPhone(在 cocos2d 中平滑拖动一个 Sprite - iPhone)...
2024-08-12 移动开发问题
10

CCScrollView 滚动和触摸事件永远不会触发
CCScrollView scroll and touch events never firing(CCScrollView 滚动和触摸事件永远不会触发)...
2024-08-12 移动开发问题
1

使用 OpenGLES 的抗锯齿去除绳索的锯齿状边缘
removing jagged edges of my ropes using antialiasing of OpenGLES(使用 OpenGLES 的抗锯齿去除绳索的锯齿状边缘)...
2024-08-12 移动开发问题
34

cocos2d 在场景之间移动
cocos2d Moving between scene(cocos2d 在场景之间移动)...
2024-08-12 移动开发问题
2