For retrieving the accounts (information) in Android versions since 2.0 you can use the AccountManager that has been introduced in Android 2.0.
But now I have the pr
call the method:
com.google.android.googlelogin.GoogleLoginServiceHelper.getAccount(Activity activity, int requestCode, boolean requireGoogle);
where: Activity: is your Activity which get the result in the onActivityResult() requestCode: your code requireGoogle: should be true
EX. GoogleLoginServiceHelper.getAccount(mActivity, 123, true);
3.override the onActivityResult() like:
protected void onActivityResult(int requestCode, int resultCode,
Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if(requestCode == 123){
System.out.println(resultCode);
String key = "accounts";
System.out.println(key + ":" +
Arrays.toString(data.getExtras().getStringArray(key)));
String accounts[] = data.getExtras().getStringArray(key);
if(accounts != null){
int i = 0;
for(String ac : accounts){ //each account is the full
email address registered with this device
System.out.println("ac " + i + "=" + ac);
i++;
}
}
}
original post is here