![]() If you do not have a DrawerLayout, you should call NavController.navigateUp() directly. This should generally be called from AppCompatActivity.onSupportNavigateUp(). Handles the Up button by delegating its behavior to the given NavController. Call navigateUp(NavController, DrawerLayout) to handle the Up button. On all other destinations, the ActionBar will show the Up button. On the start destination of your navigation graph, the ActionBar will show the drawer icon if the given DrawerLayout is non-null. The start destination of your navigation graph is considered the only top-level destination. The setupActionBarWithNavController method sets up the ActionBar returned by AppCompatActivity.getSupportActionBar() for use with a NavController.īy calling this method, the title in the action bar will automatically be updated when the destination changes (assuming there is a valid label). Implements NavigationView.In the setupDrawerLayout method, the call of setupWithNavController method Sets up a NavigationView for use with a NavController. Public class MainActivity extends AppCompatActivity On the top of the list, we have the activity_main.xml which looks as shown below:.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |