开发者

android registering contextmenu for an option menu item

开发者 https://www.devze.com 2023-03-27 20:22 出处:网络
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?

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号