【发布时间】:2014-06-02 11:01:44
【问题描述】:
凌空有没有像AsyncTask这样的方法?
我在我的应用程序中使用了 volley lib,我想在 volley 中进行一些预执行。那么在 volley lib ad 中是否有任何方法,例如 AsyncTask 中的以下方法,因为我想使用 Base64 图像字符串创建 json,而当我要使用图像创建 json 时,我的应用程序停止响应。
protected void onPreExecute() {
pDialog = ProgressDialog.show(MyActivity.this,"Please wait...", "Retrieving data ...", true);
}
protected Void doInBackground(Void... unused) {
items = parser.getItems();
for (Item it : items) {
publishProgress(it);
}
return(null);
}
protected void onProgressUpdate(Item... item) {
adapter.add(item[0]);
}
protected void onPostExecute(Void unused) {
pDialog.dismiss();
}
谢谢
【问题讨论】:
标签: android android-asynctask progressdialog android-volley