How to implement onOptionsItemSelected for Sub-Menu Items?
I have encountered a situation where I need to implement
onOptionsItemSelected listener for the subMenu of an item. The menu xml
file looks as below:
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:showAsAction="always"
android:title="@string/action_settings">
<menu>
<item android:id="@+id/create_new"
android:title="Create New" />
<item android:id="@+id/open"
android:title="Open" />
</menu>
</item>
<item android:id="@+id/new_game"
android:title="New Game"
android:showAsAction="always"/>
<item android:id="@+id/help"
android:title="Help"
android:showAsAction="always"/>
</menu>
As I'm able to implement option listener for items, where as I want to
know how to implement action listener for the action_settings that have
sub-menu items. Kindly help me regarding this I have gogled but I was
unable to find exact solution.
No comments:
Post a Comment