Я думаю, что вы хотите использовать AccountManager
Чтобы узнать тип аккаунта Google, используйте что-то вроде:
AuthenticatorDescription[] types = mAccountManager.getAuthenticatorTypes(); //
for (AuthenticatorDescription type : types) {
Log.d("account types", type.type);
}
Тогда сделайте что-то вроде
AccountManager mAccountManager = AccountManager.get(context);
Account[] mAccounts = AccountManager.get(context).getAccountsByType("com.google");
// Choose which account to use if there are multiple google accounts registered, save to Account mAccount
AccountManagerFuture<options> response = mAccountManager.getAuthToken(mAccount, type, options, activity, mCallback, mHandler); // define callback and handler yourself for where to return
Когда пользователь достигает mCallback в вашем mHandler, процесс входа в систему завершается. Обычный диалог входа в Google будет использоваться, если пользователь еще не вошел в свою учетную запись Google.
Попробуйте сами и дайте мне знать, помогло ли это вам!