Last active
January 5, 2023 22:25
-
-
Save figonzal1/70f465caed3ae7f7dd41bae4673d7cc1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val menuHost: MenuHost = requireActivity() | |
menuHost.addMenuProvider(object : MenuProvider { | |
override fun onCreateMenu(menu: Menu, menuInflater: MenuInflater) { | |
menuInflater.inflate(R.menu.myMenu, menu) | |
} | |
override fun onMenuItemSelected(menuItem: MenuItem): Boolean { | |
when (menuItem.itemId) { | |
R.id.myItem -> {} | |
} | |
return true | |
} | |
}, viewLifecycleOwner, Lifecycle.State.RESUMED) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment