有没有办法在onPostExecute
方法内过滤AsyncTask的结果?我计划显示一个MultipleChoice属性AlertDialog.Builder来过滤掉结果,而不会结束或解除ProgressDialog。
这是我想要做的过程。
AsyncTask.onPreExecute
- show ProgressDialog
AsyncTask.doInBackground
- scan all files on `Environment.getExternalStorageDirectory().listFiles()`
AsyncTask.onPostExecute
- filter the result parameter (this can be passed to another method of the Activity class or the AsyncTask class)
- display AlertDialog.Builder with multiple selection property (for example, file extension names)
- wait to finish selection on the shown AlertDialog.Builder
- display AlertDialog.Builder with multiple selection property (for example, file directories)
- wait to finish selection on the shown AlertDialog.Builder
] // do something with the filtered result
] dismiss ProgressDialog
2013年2月6日更新:
AsyncTask
完成的流程。