Reputation: 1465
I'm using a gallery in 20 pictures, but thumbnail scroll is too slow and lagging.
but I'm try someone else's gallery in 90 pictures no lag and speed.
Why my gallery might be slow?
public View getView(int position, View convertView, ViewGroup parent) {
ImageView imgView = new ImageView(context);
imgView.setImageResource(main.gallery.get(position));
imgView.setLayoutParams(new Gallery.LayoutParams(80, 80));
imgView.setScaleType(ImageView.ScaleType.FIT_XY);
imgView.setBackgroundResource(GalItemBg);
return imgView;
}
Edit: Problem is solved with a good example, here Android GalleryView Recycling
Upvotes: 1
Views: 2515
Reputation: 5033
You could use View Flipper for image gallery which you can use it for larger no of pictures,this would load to your app dynamically.
Upvotes: 0
Reputation:
You should try to "recycle" views and not always create a new one. For that you can use the passed parameter convertView.
Upvotes: 1