如何在页面加载时向我的浏览器字段添加加载对话框?
谢谢
使用 GaugeField:net.rim.device.api.ui.component.GaugeField,遵循以下示例:http ://docs.blackberry.com/en/developers/deliverables/18125/Gauge_field_1303006_11.jsp
在创建的类中使用BrowserFieldListener
和使用以下两个函数:
public void documentCreated(BrowserField browserField, ScriptEngine scriptEngine, Document document) {
try{
System.out.println("Document Created");
UiApplication.getUiApplication().invokeLater(new Runnable() { public void run() {
Dialog.alert("Loading");
}});
} catch (Exception ex) { }
}
public void documentLoaded(BrowserField browserField, Document document) {
try {
System.out.println("Document loaded");
UiApplication.getUiApplication().invokeLater(new Runnable() { public void run() {
Dialog.alert("Finished Loading");
}});
} catch (Exception ex) { }
}