Activity.runOnUiThread(new Runnable() {
void run() {
// Do stuff…
}
});
Can‘t create handler inside thread that has not called Looper.prepare()
本文介绍了一种在Android应用中更新UI线程的有效方法,通过使用Activity的runOnUiThread方法,可以确保在主线程中执行更新UI的任务,避免了因在子线程中直接操作UI而引发的崩溃问题。
2043

被折叠的 条评论
为什么被折叠?



