runOnUiThread 更新ui
来源:互联网 发布:java建立个人博客网站 编辑:程序博客网 时间:2024/06/05 17:50
/** * Runs the specified action on the UI thread. If the current thread is the UI * thread, then the action is executed immediately. If the current thread is * not the UI thread, the action is posted to the event queue of the UI thread. * * @param action the action to run on the UI thread */public final void runOnUiThread(Runnable action) { if (Thread.currentThread() != mUiThread) { mHandler.post(action); } else { action.run(); }}
在非ui thread中想要更新ui操作,需要使用runOnUiThread来完成。若当前线程是ui thread则立即执行,否则action 会被post到ui thread的event queue中。
阅读全文
0 0
- 使用runOnUiThread更新UI
- runOnUiThread 用于更新UI
- 使用runOnUiThread更新UI
- 更新UI-runOnUIThread
- runOnUiThread 更新ui
- activity 使用runOnUiThread更新 ui
- activity 使用runOnUiThread更新 ui
- Activity类的runOnUiThread更新UI
- 更新UI操作,Handler与runOnUiThread
- UI更新方法Handler和runOnUiThread
- Android 更新UI——runOnUiThread()
- 使用runOnUiThread更新主线程UI
- 使用Thread+Handler或runOnUiThread更新UI
- runOnUiThread和Handler机制更新UI
- 使用Activity类的runOnUiThread执行线程更新UI操作
- 使用Activity类的runOnUiThread执行线程更新UI操作
- runOnUIThread、Handler、AsyncTask与子线程结合使用更新UI
- Android在其它线程中更新UI,runOnUiThread() (转载)
- oracle数据库启动cannot mount database in EXCLUSIVE mode
- 多态
- Qt与opencv在嵌入式开发环境中的配置
- 比特币白皮书(阅读总结)
- Valid Parentheses有效的括号序列
- runOnUiThread 更新ui
- 页面自动延伸的方法
- Tomcat中更改网站根目录和默认页的配置方法
- Mac 下sublime配置使用Markdown和配置使用源码
- LocalMQ:从零构建类 RocketMQ 高性能消息队列
- Service Hot ITSOM企业级应用SaaS平台——工时管理
- javaMail 奇怪的NullPointerException
- MongoDB基本命令用
- php 获取移动端ip和pc端ip