Run this:
protected void startApp() throws MIDletStateChangeException {
Display.init(this);
WebBrowser browser = new WebBrowser();
Object browserInternal = browser.getInternal();
if (browserInternal instanceof HTMLComponent) {
HTMLComponent htmlComponent = (HTMLComponent) browserInternal;
htmlComponent.setIgnoreCSS(false);
htmlComponent.setEventsEnabled(true);
htmlComponent.setRequestHandler(new MyDefaultDocumentRequestHandler());
}
Form f = new Form();
f.setLayout(new GridLayout(1, 1));
f.addComponent(browser);
f.show();
browser.setURL("jar:///splash.html");
browser.setURL("jar:///splash.html");
}
The XHTML looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN"
"http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html>
<head>
<!-- some data -->
<style type="text/css">
body {
background-image:url("jar:///bozza.png");
background-repeat:no-repeat;
background-attachment:fixed;
background-position:center;
}
</style>
</head>
<body>
</body>
</html>
The problem is doing a second setURL(). The first setURL works fine. Adding
another one throws a BANG!
java.lang.ClassCastException
at com.codename1.ui.html.ResourceThreadQueue$ResourceThread.handleImage(+71)
at com.codename1.ui.html.ResourceThreadQueue$ResourceThread.handleImage(+49)
at com.codename1.ui.html.ResourceThreadQueue$ResourceThread.access$0(+6)
at com.codename1.ui.html.ResourceThreadQueue$1.run(+21)
at com.codename1.ui.Display.processSerialCalls(+114)
at com.codename1.ui.Display.edtLoopImpl(+269)
at com.codename1.ui.Display.mainEDTLoop(+216)
at com.codename1.ui.RunnableWrapper.run(+233)
Original issue reported on code.google.com by jkoo...@gmail.com on 18 Apr 2012 at 8:20
Original issue reported on code.google.com by
jkoo...@gmail.com
on 18 Apr 2012 at 8:20