我已經部署了我的黑莓應用程序,它從資源文件加載html頁面。該HTML文件有JavaScript和jQuery,我需要啓用JavaScript在Android中。如何在BrowserField中啓用JavaScript?
BrowserField browser = new BrowserField();
add(browser);
InputStream content = getClass().getResourceAsStream("/resourcesWeb/index.html");
try {
byte[] html = IOUtilities.streamToBytes(content);
browser.displayContent(new String(html), "http://localhost");
} catch (IOException e) {
e.printStackTrace();
}
[請參閱此鏈接(http://supportforums.blackberry.com/t5/Java-Development/BrowserField-Sample-Code-Using-the-BrowserFieldConfig-class/ta-p/495716) – Nate