I have a menu in which all items have a checkbox. So it is like a multichoice menu. I don't want the menu to close when an item is clicked. I only want to close the menu on back press. But I can't figure out how to do it?
This is the code:
override fun onOptionsItemSelected(item: MenuItem): Boolean {
when(item.itemId) {
R.id.my_item -> {
// toggle
}
}
// something to do here?
// changing return value to true or false doesn't help
return false
}