0
Follow
0
View

Log out button on side menu wont redirect to LoginActivity(Android)

ddl23010 注册会员
2023-01-25 05:46
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
     if (item.getTitle().equals("Log out :(")) {
            mAuth.signOut();
            startActivity(new Intent(MainActivity.this, LoginActivity.class));
            return false;
     }
}

This work for me..

Try This...

zhaoyameng888 注册会员
2023-01-25 05:46

Ive been searching all day long and found out that the reason items in the side menu dont click is beacuse you have to put the "NavigationView" before the last closing attribute in your xml file. Not sure why but it worked !