问题
The question has been indirectly spoken about in some of the earlier questions but i havent seen anything decisive about it..
I am currently using this piece of code to show a LWUIT form inside CommandAction
implementation.
public void commandAction(Command cmnd, Item item) {
if (item == LogIn && cmnd == maincommand) {
RechForm = new com.sun.lwuit.Form("Basefook");
HttpRequestHandler handler = new HttpRequestHandler();
HTMLComponent htmlc = new HTMLComponent(handler);
htmlc.setPage("http://facebook.com");
RechForm.addComponent(BorderLayout.CENTER, htmlc);
com.sun.lwuit.Display.init(this);
RechForm.show();
}
}
Currently it doesnt bring up the form ,nor does it crash.
well if thats not possible then can you suggest a workaround to some sort of browser control for MIDP based of lcdui?
回答1:
Solved it.It now works.Just put the com.sun.lwuit.Display.init(this);
into startApp()
and change
RechForm.addComponent(BorderLayout.CENTER, htmlc);
to
RechForm.addComponent(htmlc);
来源:https://stackoverflow.com/questions/14893318/how-to-launch-a-lwuit-form-from-a-lcdui-form