Joshua
05/09/2020, 1:59 PMval navController = findNavController(R.id.nav_host_fragment)
val appBarConfiguration = AppBarConfiguration(navController.graph)
findViewById<androidx.appcompat.widget.Toolbar>(R.id.toolbar).setupWithNavController(navController,appBarConfiguration)
setSupportActionBar(findViewById(R.id.toolbar))
This code is from my activity
What I'm trying to do is, set this default back-arrow autogenerated button to a hamburger icon instead.Ian Lake
05/09/2020, 3:36 PMJoshua
05/09/2020, 5:46 PMval appBarConfiguration = AppBarConfiguration(setOf(R.id.homeFragment,R.id.goOnlineFragment,R.id.addJobFragment))
and I also did:
supportActionBar?.setDisplayHomeAsUpEnabled(true)
I was also not sure If I'm supposed to add a drawerlayout to my fragments, since I'm using single activity pattern and use the drawerlayout in my main_activity.xml I already wrap the fragment with a drawerlayout. When I tried to add a drawerlayout to the fragments as well, nothing disapeard. Instead of having the back-button now I just have a title in my toolbar.Ian Lake
05/09/2020, 6:00 PMsetDisplayHomeAsUpEnabled
, it does that for youIan Lake
05/09/2020, 6:01 PM