I am completely new to Android Studio and just learned Object-oriented programming. My project requires me to build something on open-source code. I added a new menu item to a menu and want to start another activity once the user clicks the menu item with id: plot. The intent will be sent from if (id == R.id.plot) within onOptionsItemSelected(MenuItem item)
Tag: menuitem
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.