Java – conflict listfield click and menu click

In my application, I have placed listfield on the screen Now my problem is that when I click on a list item (when the list item has focus), it performs an activity to open the menu

I want to disable the menu when I click on the list I hope that if I click on a list item, it should only perform the necessary tasks defined in the item click event and not display the menu with it

Does anyone know anything about it?

Solution

Override your listfield's navigationclick() to use the click event (which should return true) without calling super navigationClick():

protected boolean navigationClick(int status,int time) {
    Status.show("Clicked on item: " + myList.getSelectedIndex());
    return true;
}
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>