0

How can I add an loading dialog to my Browserfield when the page is loading?

Thanks

Rick de Jong
  • 237
  • 1
  • 4
  • 12

2 Answers2

0

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

rosco
  • 939
  • 9
  • 16
0

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) { }
}
Farid Farhat
  • 2,300
  • 1
  • 16
  • 29