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.
精彩评论