| | |
| | | package com.duqing.missions; |
| | | |
| | | import android.os.Bundle; |
| | | |
| | | import androidx.navigation.NavController; |
| | | import androidx.navigation.Navigation; |
| | | import androidx.navigation.ui.AppBarConfiguration; |
| | | import androidx.navigation.ui.NavigationUI; |
| | | |
| | | import com.duqing.missions.base.BaseActivity; |
| | |
| | | |
| | | |
| | | @Override |
| | | protected void onCreate(Bundle savedInstanceState) { |
| | | super.onCreate(savedInstanceState); |
| | | |
| | | public void initViews() { |
| | | // Passing each menu ID as a set of Ids because each |
| | | // menu should be considered as top level destinations. |
| | | AppBarConfiguration appBarConfiguration = new AppBarConfiguration.Builder( |
| | | R.id.navigation_home, R.id.navigation_dashboard, R.id.navigation_notifications) |
| | | .build(); |
| | | NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_activity_main); |
| | | NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration); |
| | | NavigationUI.setupWithNavController(binding.navView, navController); |
| | | } |
| | | |