evan
evan

Reputation: 1118

BlackBerry dynamically updating ListField

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.

Upvotes: 4

Views: 1146

Answers (2)

Alexander Farber
Alexander Farber

Reputation: 23058

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();
    }
});

Upvotes: 5

Richard
Richard

Reputation: 8920

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.

Upvotes: 3

Related Questions