How can I add an loading dialog to my Browserfield when the page is loading?
Thanks
How can I add an loading dialog to my Browserfield when the page is loading?
Thanks
Use a GaugeField: net.rim.device.api.ui.component.GaugeField, following the example at: http://docs.blackberry.com/en/developers/deliverables/18125/Gauge_field_1303006_11.jsp
Use BrowserFieldListener
and use the following two functions in the class created:
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) { }
}