Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- Toolbar toolbar = findViewById(R.id.toolbar);
- setSupportActionBar(toolbar);
- DrawerLayout drawer = findViewById(R.id.drawer_layout);
- NavigationView navigationView = findViewById(R.id.nav_view);
- // Passing each menu ID as a set of Ids because each
- // menu should be considered as top level destinations.
- mAppBarConfiguration = new AppBarConfiguration.Builder(
- R.id.nav_home, R.id.nav_ip_address, R.id.nav_schedule, R.id.nav_setting_audio)
- .setDrawerLayout(drawer)
- .build();
- NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
- NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration);
- NavigationUI.setupWithNavController(navigationView, navController);
Add Comment
Please, Sign In to add comment