加载对话框BlackBerry Browserfield

时间:2012-03-07 12:14:04

标签: blackberry browserfield

如何在加载页面时向我的Browserfield添加加载对话框?

由于

2 个答案:

答案 0 :(得分:0)

使用GaugeField:net.rim.device.api.ui.component.GaugeField, 按照以下示例进行操作:http://docs.blackberry.com/en/developers/deliverables/18125/Gauge_field_1303006_11.jsp

答案 1 :(得分:0)

使用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) { }
}