本文介绍了黑莓动态更新ListField的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有可能更新黑莓 ListField
动态?
Is it possible to update BlackBerry ListField
dynamically?
首先,我创建了一个列表视图与10个对象,一个后台服务在后台运行,收集的对象,一段时间后,我得到了几个对象,我要添加这些新对象已经存在的 ListField
。
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.
推荐答案
是的,应该是可能的 - 将对象添加到您的数据结构(例如矢量),然后调用:
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();
}
});
这篇关于黑莓动态更新ListField的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!