private
class downloadImage
extends AsyncTask<String, Integer, Bitmap> {
Bitmap[] bms;
@Override
protected Bitmap doInBackground(String... arg0) {
// TODO Auto-generated method stub
bms =
new Bitmap[arg0.length];
for (
int i = 0; i < arg0.length; i++) {
Bitmap bm = Common.GetImages(arg0[i],
"219.136.252.234");
bms[i] = bm;
publishProgress(i);
}
return
null;
}
@Override
protected
void onProgressUpdate(Integer... values) {
// TODO Auto-generated method stub
adapter =
new ImageAdapter(Activity_Gallery.
this, bms);
galleryFlow.setAdapter(adapter);
adapter.notifyDataSetChanged();
super.onProgressUpdate(values);
}
@Override
protected
void onPostExecute(Bitmap result) {
// TODO Auto-generated method stub
adapter =
new ImageAdapter(Activity_Gallery.
this, bms);
galleryFlow.setAdapter(adapter);
adapter.notifyDataSetChanged();
galleryFlow.setSelection(5,
true);
setGalleryMovie(
true);
super.onPostExecute(result);
}
}
Android 如何用gallery批量顯示網絡圖片.弄成那種在線瀏覽網頁的圖片.