Navigation Component, Control when to show hamburger or back icon
问题 I have the following Activity class MainActivity : AppCompatActivity() { private lateinit var drawerLayout: androidx.drawerlayout.widget.DrawerLayout override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.main_activity) drawerLayout = drawer_layout val navController = Navigation.findNavController(this, R.id.fragment_main_navHost) setSupportActionBar(toolbar) NavigationUI.setupActionBarWithNavController(this, navController, drawerLayout)