Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class OverflowMenuActivity : AppCompatActivity() {
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- setContentView(R.layout.activity_over_flow_menu)
- setSupportActionBar(toolBar)
- title = "Overflow Menu Activity"
- supportActionBar!!.setDisplayHomeAsUpEnabled(false)
- supportActionBar!!.setDisplayShowTitleEnabled(false)
- }
- override fun onCreateOptionsMenu(menu: Menu?): Boolean {
- MenuInflater(this).inflate(R.menu.menu_overflow, menu)
- return super.onCreateOptionsMenu(menu)
- }
- override fun onOptionsItemSelected(item: MenuItem?): Boolean {
- NavigationUI.onNavDestinationSelected(item!!, Navigation.findNavController(this, R.id.navOverFlowMenuActivity))
- return super.onOptionsItemSelected(item)
- }
- }
Add Comment
Please, Sign In to add comment