Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的 MIDlet 应用程序有问题。
每当我执行此 MIDlet 时,模拟器都会显示错误:“此应用程序不使用屏幕,而是在后台运行”。
到目前为止,我知道我们必须将屏幕的引用提供给 Display 的实例,为此我这样做了:
private Display display; display = Display.getDisplay(this);
我仍然面临上述错误。请在这件事上给予我帮助
您不仅需要初始化显示,还需要设置当前表单:
mainForm= new Form("My Form"); display = Display.getDisplay(this); display.setCurrent(mainForm);
检查可显示变量的 commandAction 参数。如果你给 Displayable 和 Display 相同的变量,那么你会得到上面的错误。通常,Display 和 Displayable 被赋予“d”作为导致问题的变量名。