相关疑难解决方法(0)

FirebaseAuth.getInstance().signOut() 不注销

我尝试从 firebase 注销用户,但在关闭应用程序并再次打开后,用户仍然处于连接状态

我尝试从 firebase 定期注销用户,但没有解决问题。我想知道是什么导致了这个问题

 logout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                FirebaseAuth.getInstance().signOut();
                Intent picture_intent = new Intent(Dashboard.this,LoginActivity.class);
                startActivity(picture_intent );
            }
        });
Run Code Online (Sandbox Code Playgroud)

我检查用户是否连接:

@Override
    public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
        FirebaseUser currentUser = firebaseAuth.getCurrentUser();
        if(currentUser != null)
        {
            SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
            int again = preferences.getInt(String.valueOf(R.string.remember_me), 0);
            if(again == 0)
            {
                Intent i = new Intent(getApplicationContext(), PagerActivity.class);
                startActivity(i);
            }
            else
            {
                Intent i = new Intent(getApplicationContext(), Dashboard.class);
                startActivity(i);
            }

        }
    }
Run Code Online (Sandbox Code Playgroud)

java android firebase firebase-authentication

3
推荐指数
1
解决办法
2800
查看次数

标签 统计

android ×1

firebase ×1

firebase-authentication ×1

java ×1