开发者

how can i replace a field of manager in thread

I want to replace a field of verticalFieldManager in thread ,how 开发者_JS百科can i do this


To update the from a separate thread, you need to either be holding the event lock or running on the event thread. The most sure-fire way to do this is the use invokeLater() to put your request in the Event Queue to be processed on the Event Thread.

public void run() { //this is your Runnable for your Thread
    //do stuff
    UiApplication.getUiApplication().invokeLater(new Runnable() {
        public void run() {
            vfm.replace(oldField, newField);
        }
    });
}

vfm will need to be a class variable or declared final to be visible to this.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜