Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class NavigationDrawerActivity : AppCompatActivity() {
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- setContentView(R.layout.activity_navigation_drawer)
- setSupportActionBar(toolBar)
- title = "Navigation Drawer Activity"
- supportActionBar!!.setDisplayHomeAsUpEnabled(true)
- supportActionBar!!.setDisplayShowTitleEnabled(false)
- setUpDrawerToggle()
- NavigationUI.setupWithNavController(navView, Navigation.findNavController(this, R.id.navDrawerActivity)) // here navView using Kotlin extension to avoid findviewbyid
- }
- }
Add Comment
Please, Sign In to add comment