Guest User

Untitled

a guest
May 24th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. class OverflowMenuActivity : AppCompatActivity() {
  2.  
  3. override fun onCreate(savedInstanceState: Bundle?) {
  4. super.onCreate(savedInstanceState)
  5. setContentView(R.layout.activity_over_flow_menu)
  6. setSupportActionBar(toolBar)
  7. title = "Overflow Menu Activity"
  8. supportActionBar!!.setDisplayHomeAsUpEnabled(false)
  9. supportActionBar!!.setDisplayShowTitleEnabled(false)
  10. }
  11.  
  12. override fun onCreateOptionsMenu(menu: Menu?): Boolean {
  13. MenuInflater(this).inflate(R.menu.menu_overflow, menu)
  14. return super.onCreateOptionsMenu(menu)
  15. }
  16.  
  17. override fun onOptionsItemSelected(item: MenuItem?): Boolean {
  18. NavigationUI.onNavDestinationSelected(item!!, Navigation.findNavController(this, R.id.navOverFlowMenuActivity))
  19. return super.onOptionsItemSelected(item)
  20. }
  21. }
Add Comment
Please, Sign In to add comment