我在 LWUIT 浏览器示例中使用 HttpRequestHandler。当我初始化 HttpRequestHandler 时,我得到 java.lang.Error: Static initializer: java.lang.NullPointerException。这是我在 startApp 中的代码。公共无效startApp(){
Display.init(this);
try {
InputStream imageStream= Home.class.getResourceAsStream("tipster.res");
//String filesPathAndName = url.getPath();
Resources r = Resources.open(imageStream);
UIManager.getInstance().setThemeProps(r.getTheme("Theme 2"));
} catch (IOException ioe) {
ioe.printStackTrace();
// Do something here.
}
HttpRequestHandler handler = new HttpRequestHandler();
HTMLComponent h = new HTMLComponent(handler);
h.setPage("http://m.google.com");
ffForm.addComponent(h);
}