问题
I am developing an app with Blackberry OS 5.0. Is there any UI Handler(like in android) which updates the UI of the present screen. I am using thread's in my app,when a thread is running at the same time i need to update my UI of the screen. Right now,after my thread is completed, i am popping the present screen and push the new screen again. Then only my UI is getting updated. Is there any alternative way to update UI when thread is running.
回答1:
Yes, there's a much better way of doing it: Perform your updates on the UI thread. Example:
Application.getUiApplication().invokeLater(new Runnable(){
public void run(){
editField.setText("My updated text");
}
}
回答2:
You need to invalidate the UI and update the UI you can also delete all Ui and reload it for particular condition. like getmainManger.deleteAll();
This method delete all UI and you can load new UI and update all UI.
来源:https://stackoverflow.com/questions/12088189/in-blackberry-os-5-0-is-there-any-ui-handler-to-update-ui-of-the-screen