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

How to find Gmail account associated with Android Market?(如何找到与 Android Market 关联的 Gmail 帐户?)

本文介绍了如何找到与 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 帐户?

基础教程推荐