开发者

ANdroid menu items display only when focus to particular widget

开发者 https://www.devze.com 2023-03-30 17:39 出处:网络
In my android application I have a list view and some other buttons above the listview. I need to implement the functionality to add the selected item of the listview to my favourites list by creating

In my android application I have a list view and some other buttons above the listview. I need to implement the functionality to add the selected item of the listview to my favourites list by creating a menu item.

I can create a menu item to click and add the functionality.

But it should 开发者_JS百科only show the menu item if the focus is on any listview item and not when the focus is on any other button or anyItem. the menu item should only display when the focus is on any listview item and press the menu button.

Can Someone help me please.


Have you considered using a context menu instead of trying to modify the main menu? It seems like behavior might be more in line with the UI guidelines.

0

精彩评论

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