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
You should try to "recycle" views and not always create a new one. For that you can use the passed parameter convertView.