android registering contextmenu for an option menu item
I want on an option menu item click a context menu shoul开发者_StackOverflow社区d come. Is it possible to register a context menu for an option menu item? If it possible then how?
Thanks.
Just read documentation about menus in android:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/item1"
android:icon="@drawable/item1"
android:title="@string/item1" />
<!-- menu group -->
<group android:id="@+id/group1">
<item android:id="@+id/groupItem1"
android:title="@string/groupItem1" />
<item android:id="@+id/groupItem2"
android:title="@string/groupItem2" />
</group>
</menu>
check this;
http://developer.android.com/guide/topics/ui/menus.html
http://developer.android.com/guide/topics/resources/menu-resource.html
精彩评论