0

如何在页面加载时向我的浏览器字段添加加载对话框?

谢谢

4

2 回答 2

0

使用 GaugeField:net.rim.device.api.ui.component.GaugeField,遵循以下示例:http ://docs.blackberry.com/en/developers/deliverables/18125/Gauge_field_1303006_11.jsp

于 2012-03-07T12:37:16.187 回答
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) { }
}
于 2012-03-07T12:40:08.553 回答