【发布时间】:2010-08-10 23:35:11
【问题描述】:
我有一个创建自定义视图的 Android 活动,这是一个昂贵的过程。我尝试使用处理程序,但是当我这样做时,显示的进度对话框每 5 秒旋转一次。所以我尝试使用 AsyncTask。现在 progressDialog 旋转,但随后它崩溃了,因为它不允许加载 UI?如何在不发生 ANR 的情况下执行此操作?
08-10 19:28:21.313: ERROR/AndroidRuntime(1428): Caused by: android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
【问题讨论】:
标签: android multithreading concurrency handler android-asynctask