I have the following code that gets the whole gmail id that is synchronized with my phone, but I want the first gmail id that the user registered for the first time. Since all other gmail accounts (not primary), if I want, I can delete at any time, but delete the main account, we also have to do other things. Therefore, I want the main account to be used in my application.
here is my code, I think, to add some kind of filter to it, I can do it, but I can’t do it right.
Account[] accounts=AccountManager.get(this).getAccountsByType("com.google");
for(Account account: accounts)
{
String possibleEmail=account.name;
Log.d("Possible email id of user", possibleEmail);
}
I already saw the Roman link , but could not convert it correctly. I want to use this primary email address for push notification using C2DM from Google.
source
share