BlackBerry dynamically updating ListField

一个人想着一个人 提交于 2019-12-10 16:26:59

问题


Is it possible to update BlackBerry ListField dynamically?

First I have created a listview with 10 objects, a background service is running in the background to collect the objects, after a while I got few more objects, I want to add these new objects to already existing ListField without reloading the MainScreen.


回答1:


Yes, should be possible - add objects to your data structure (for example a Vector) and then call:

UiApplication.getUiApplication().invokeLater(new Runnable() {
    public void run() {
        myList.setSize(myVector.size());
        myList.invalidate();
    }
});



回答2:


Yes. You change update the backing store where you have the values that are displayed in the list, then call one of the setSize methods on your ListField.



来源:https://stackoverflow.com/questions/6088484/blackberry-dynamically-updating-listfield

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!