当我创建一个表单和一个midlet时遇到麻烦我想在用户输入详细信息时通过用户提醒,但是我遇到了麻烦,它无法更改屏幕以显示警报
答案 0 :(得分:1)
// ... your AddReview class
public AddReview(String title, MainFoodie mf) {
super(title);
this.mf = mf; // without that you'll get NPE in changeSreen
// ...
}
//...
private void changeScreen(Alert a, Form f){
Display.getDisplay(mf).setCurrent(a, f);
}
public void commandAction(Command c, Displayable d) {
if(c.getLabel().equals("Save")){
// how to show alert here:
changeScreen(cfmAlert, this)
}