0

为什么我在主要活动和登录活动之间出现无限循环?

    @Override
    protected void onStart() {
        super.onStart();
        if (mAuthListener == null) {
            //removeAuthSateListner is used in onStart function just for checking purposes, it helps in logging you out.
            startActivity(new Intent(this, LoginActivity.class));
        } else
            startActivity(new Intent(this, EditProfileActivity.class));
    }

    @Override
    protected void onStop() {
        super.onStop();
        if (mAuthListener != null) {
            mAuth.removeAuthStateListener(mAuthListener);
        }
    }

这段代码正确吗?

4

0 回答 0