黑莓OS 5.0,是否有任何UI处理程序更新屏幕的UI [英] In Blackberry OS 5.0 , Is there any UI Handler to update UI of the Screen

查看:679
本文介绍了黑莓OS 5.0,是否有任何UI处理程序更新屏幕的UI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发展与黑莓OS 5.0的应用程序。是否有任何UI处理程序(如android系统),它更新了present屏幕的UI。我使用的线程在我的应用程序,当一个线程在同一时间,我需要更新我的屏幕UI运行。现在,我的线程完成后,我大跌眼镜的present屏幕,并再次推新屏幕。那么只有我的用户界面得到更新。是否有线程在运行时更新UI的另一种方式。

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.

推荐答案

是的,有这样做的更好的方法:在UI线程上执行更新。例如:

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

这篇关于黑莓OS 5.0,是否有任何UI处理程序更新屏幕的UI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆