我無法在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。我無法做到這一點。 –