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;
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
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).
Thanks for the help.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…