Firebase onAuthStateChanged签名无限循环

时间:2016-09-04 06:09:46

标签: android firebase firebase-authentication

我面临无限问题与firebase谷歌登录,我从firebase控制台手动删除用户。我尝试了许多选项,如unistalling应用程序,删除谷歌帐户仍然无限循环持续。   如果我将其他updateUI方法留空,我将登陆空白屏幕

    mAuthListener = new FirebaseAuth.AuthStateListener() {
        @Override
        public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
            FirebaseUser firebaseUser = firebaseAuth.getCurrentUser();
            Log.d(TAG,firebaseAuth.toString());
            if (firebaseUser != null) {
                user=new User(firebaseUser);
                Log.d(TAG, "onAuthStateChanged:signed_in:" + firebaseUser.getUid());
            } else {
                Log.d(TAG, "onAuthStateChanged:signed_out");
            }
            updateUI(firebaseUser);
        }
    };

}

private void updateUI(FirebaseUser firebaseUser){
    hideProgressDialog();
    if(firebaseUser!=null){
        saveUser();
        Intent intent = new Intent(LoginActivity.this, MainActivity.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
        startActivity(intent);
        finish();

    }else{
        Log.d(TAG, "Else part executed");
        revokeAccess();
        Intent intent = new Intent(LoginActivity.this, SplashActivity.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
        startActivity(intent);
        finish();
       // logout();
    }

}

记录

09-04 11:36:06.824 27913-27913/com.renteasy D/com.renteasy.views.activity.LoginActivity: com.google.android.gms.internal.zzaft@327a804c
09-04 11:36:06.824 27913-27913/com.renteasy D/com.renteasy.views.activity.LoginActivity: onAuthStateChanged:signed_out
09-04 11:36:06.824 27913-27913/com.renteasy D/com.renteasy.views.activity.LoginActivity: Else part executed
09-04 11:36:06.874 27913-27913/com.renteasy D/com.renteasy.views.activity.LoginActivity: com.google.android.gms.internal.zzaft@327a804c
09-04 11:36:06.874 27913-27913/com.renteasy D/com.renteasy.views.activity.LoginActivity: onAuthStateChanged:signed_out
09-04 11:36:06.874 27913-27913/com.renteasy D/com.renteasy.views.activity.LoginActivity: Else part executed
09-04 11:36:06.884 27913-27913/com.renteasy D/com.renteasy.views.activity.LoginActivity: Revoking access
09-04 11:36:06.884 27913-27913/com.renteasy D/com.renteasy.views.activity.LoginActivity: Revoking access

0 个答案:

没有答案