I have got a problem with my MIDlet applicat开发者_JS百科ion.
Whenever I execute this MIDlet the emulator shows the error: 'This application does not use the screen, and runs in background'.
So far I know that we have to give the reference of the screen to the instance of the Display, for that I did this:
private Display display;
display = Display.getDisplay(this);
Still I am facing the above error. please help me with this
Not only do you need to initialize the display you also need to set the current form:
mainForm= new Form("My Form");
display = Display.getDisplay(this);
display.setCurrent(mainForm);
Check your commandAction parameter for Displayable's variable. If you give Displayable and Display the same variable, then you get the above error. Often, Display and Displayable are given "d" as the variable name which causes a problem.
精彩评论