Firebase:使用FirebaseAuth.signout()

时间:2017-04-17 07:09:50

标签: android firebase firebase-authentication recycler-adapter

在我的应用中,我从主要活动的操作菜单中退出:

FirebaseAuth.singout()

我正在尝试清除用户数据,但是当不再有当前用户时,我的片段将数据保存在viewpager中不会触发authLister来清理适配器。

authListener = new FirebaseAuth.AuthStateListener() {
        @Override
        public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {

            if (firebaseAuth.getCurrentUser() != null) {

                setupRecyclerView();


            } else {
                // User is signed out
                adapter.cleanup();
            }
        }
    };

0 个答案:

没有答案