Reputation: 6240
I have a view pager which shows downloaded images from server. While the images are being downloaded I show an empty stub as default.
But instead of the stub i wanted progress dialog to be shown here until the image is downloaded. How can i do this?
image display method:
public void DisplayImage(String url, Activity activity, ImageView imageView) {
imageViews.put(imageView, url);
Bitmap bitmap = memoryCache.get(url);
if (bitmap != null)
imageView.setImageBitmap(bitmap);
else {
queuePhoto(url, activity, imageView);
imageView.setImageResource(stub_id);
}
}
Upvotes: 0
Views: 1579
Reputation: 29436
Build a a progress dialog: ProgressDialog.show(context,"loading","loading");
Or
Place the ImageView
along with a ProgressBar
(preferably the intermediate spinner) in a FrameLayout
and switch their visibility via setVisibilty()
.
Upvotes: 3