1

Как обновление вопроса

GoogleSignInClient mGoogleSignInClient = GoogleSignIn.getClient(this, gso);
Intent signInIntent = mGoogleSignInClient.getSignInIntent();
startActivityForResult(signInIntent, AUTH_REQUEST);

...
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
     super.onActivityResult(requestCode, resultCode, data);

        if (requestCode == AUTH_REQUEST) {
            if (resultCode == RESULT_OK) { // результат не ок!

                    Task<GoogleSignInAccount> task = GoogleSignIn.getSignedInAccountFromIntent(data);
                    try {

                        GoogleSignInAccount account = task.getResult(ApiException.class);
                        firebaseAuthWithGoogle(account);
                    } catch (ApiException e) {...}
}
...

После startActivityForResult стартует активность с выбором аккаунта, после выбора- экран затемняется на (0,5-1сек) что бы подключится. Если в этот момент нажать по экрану, то

 resultCode  == RESULT_CANCELED

com.google.android.gms.common.api.ApiException: 16

Вопрос: как предотвратить реакцию на нажатие?

1 ответ 1

1

Ничего сделать нельзя. Вы запускаете стороннее приложение над которым контроля у вас нет. Вам надо вручную обрабатывать resultCode != RESULT_OK и выводить юзеру сообщение что авторизация прервана.

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.