Android action bar checkable menu item does not work/show properly?

后端 未结 3 2078
迷失自我
迷失自我 2020-12-06 10:05

so I am trying to get my menu item, that is show on the action bar to behave like a checkable menu option. The firs part works, meaning it is checkable and when I press it,

3条回答
  •  北荒
    北荒 (楼主)
    2020-12-06 10:42

    Checkable items appear only in submenus or context menus.

    You are using them as main menu items, hence it will not work.

    SOURCE: Download the API DEMOS, and open the file ApiDemos/res/menu/checkable.xml, you'll see it as a comment on line 13. I don't know why they don't mention this in the Developer Documentation

    reference with comment.: http://alvinalexander.com/java/jwarehouse/android-examples/platforms/android-2/samples/ApiDemos/res/menu/checkable.xml.shtml

提交回复
热议问题