0

In my Android application i am retrieving all the gallery pictures and display in grid view. I have implemented the loading of images on Async task by using following reference link:- http://developer.android.com/training/displaying-bitmaps/process-bitmap.html

It is working fine.

My gridview looks like this

enter image description here

But i want to progress bar on loading images like this

enter image description here

Also if it is easier default image in place of loading images instead of progress bae will be fine.

Please provide me solution to implement this.

void
  • 479
  • 2
  • 13
  • 27

2 Answers2

0

Consider using this library, it allows you to specify in it's options builder

showStubImage(R.drawable.pic_placeholder)

which will appear as the library is loading your image.

https://github.com/nostra13/Android-Universal-Image-Loader

Example usage would be:

// Outside your getView method
picOptions = new DisplayImageOptions.Builder()
            .showStubImage(R.drawable.clip_placeholder)
            .build();

// Inside getView method
ImageLoader.getInstance().displayImage(picUri, imageView, picOptions);
bclymer
  • 6,679
  • 2
  • 27
  • 36
  • If my understanding is correct..I have already implemented loading of images in Async task.Does it affects by using this Library? – void Feb 18 '13 at 18:25
0

To the grid view you inflate the layout (which consisting of progress bar and the image view) instead of just the image view i.e is in the getview method of the adapter class And pass progress bar id as parameter to each asyc class, in onpreExecute method make it visible,and on postexecute make it visibality gone

vicky
  • 340
  • 5
  • 13