Skip to content
Advertisement

Tag: menu

Why click on optionsMenu item doesn’t work?

I have a problem when clicking on an item from an options menu. I’ve read how to create a menu on the website https://developer.android.com/guide/topics/ui/menus and I seem to do it right, but it still doesn’t work. The menu exists, it is visible, but nothing happens when I perform the click. Also, there are no errors in the Logcat. The XML

How to change menu item text dynamically in Android

I’m trying to change the title of a menu item from outside of the onOptionsItemSelected(MenuItem item) method. I already do the following; however I’d like to be able to modify the title of a particular menu item outside of this method. Answer As JxDarkAngel suggested, calling this from anywhere in your Activity, and then overriding: is a much better choice.

Advertisement