I have a question for the navigation drawer!
There are A and B in the navigation drawer menu I want to make sure that menu B is selected when I press the protection button on the screen that comes out when I press menu A. What should I do?
android
I think the method will change depending on how you implemented the menu of the navigation drawer. First, when creating a new project in Android Studio, I clicked on "Navigation Drawer Activity" in the project wizard and explained it based on the code created.
You can use the setCheckedItem() function in NagationView to select a specific menu in the navigation drawer.
final NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
navigationView.setNavigationItemSelectedListener(this);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
navigationView.setCheckedItem(R.id.nav_manage);
}
});
738 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
543 Uncaught (inpromise) Error on Electron: An object could not be cloned
551 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
549 Who developed the "avformat-59.dll" that comes with FFmpeg?
© 2024 OneMinuteCode. All rights reserved.