android从AsyncTask过滤结果

时间:2013-02-06 10:51:30

标签: android android-asynctask progressdialog android-alertdialog

有没有办法在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完成的流程。
  • 过滤器进程可以作为Activity类文件中的另一种方法。

0 个答案:

没有答案