我正在尝试运行一个非常简单的实现 BrowserField 类的 Blackberry/Java 应用程序。当我在模拟器中启动它时,它只是挂起。当我在我的设备上启动它时,什么也没有发生。
JRE:7.0 模拟器:4.0.0.141
package mypackage;
import net.rim.device.api.browser.field2.BrowserField;
import net.rim.device.api.browser.field2.BrowserFieldConfig;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.container.MainScreen;
public class BrowserJazz extends UiApplication
{
public static void main(String[] args)
{
BrowserJazz app = new BrowserJazz();
app.enterEventDispatcher();
}
public void BrowserJazz()
{
pushScreen(new BrowserFieldDemoScreen());
}
}
class BrowserFieldDemoScreen extends MainScreen
{
public BrowserFieldDemoScreen()
{
BrowserFieldConfig myBrowserFieldConfig = new BrowserFieldConfig();
myBrowserFieldConfig.setProperty(BrowserFieldConfig.NAVIGATION_MODE,
BrowserFieldConfig.NAVIGATION_MODE_POINTER);
BrowserField browserField = new BrowserField(myBrowserFieldConfig);
/*BrowserFieldListener listener = new BrowserFieldListener() {
public void documentLoaded(BrowserField browserField) throws Exception
{
// the document has loaded, do something ...
Dialog.inform("PAGE LOADED!");
}
};*/
add(browserField);
//browserField.addListener( listener );
browserField.requestContent("http://www.google.com");
//browserField.addListener( listener );
}
}
有任何想法吗?