在我的应用程序中有一个按钮,当单击该按钮时,将弹出上下文菜单。如何避免显示上下文菜单?
protected void makeMenu(Menu menu, int context){
menu.add(_imageMenuItem);
super.makeMenu(menu, context);
}
class ImageMenuItem extends MenuItem {
ImageMenuItem() {
super("Login Screen", 0, 0);
}
public boolean onMenu(int i) {
return false;
}
public void run() {
UiApplication app = (UiApplication) getApplication();
app.pushScreen(new LoginScreen());
}
}
最佳答案
您是否通过构造函数向ButtonField添加了样式?
ButtonField button =
new ButtonField("text", Field.H_CENTRE|ButtonField.CONSUME_CLICK);
关于blackberry - 避免在单击按钮时显示菜单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4918778/