我无法在AsyncTask的doInBackground
方法内运行ProgressDialog
。它给了我下面的错误:为什么我不能在AsyncTask的doInBackground方法内运行ProgressDialog?
ERROR/AndroidRuntime(12986): Caused by: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
而且误差在这一行中的代码:
final ProgressDialog dialog = ProgressDialog.show(GalleryView.this, "Refresh", "Loading... please wait", true);
任何帮助非常赞赏。
好的,这就是我想要做的。我想在一段代码上运行progressdialog。一旦代码完成,我关闭对话框并想调用AsyncTask来刷新我的UI。我无法做到这一点。 –