Reputation: 32263
I'm following that example for creating a image gallery.For avoiding memory crash when loading a high number of images I have resized the images to the cell size using BitmapFactory.
But the problem still there when trying to load higher images or using a phone with less heap size. So i'm trying to detect when a image is visible and when it is not longer visible for reload/free the bitmap.
I detect when a cell becomes visible with
public View getView(int position, View convertView, ViewGroup parent) {
}
But I dont know how to detect when a View goes out of the scroll. Can you help me?
Thanks!
Upvotes: 0
Views: 97
Reputation: 3872
Generally speaking, when showing large images in a gridview, you want to have pre-made thumbnails that you display instead. It takes a lot of memory to display several large images, then having to compress them to 5% of their original size.
Upvotes: 1
Reputation: 42026
i think here you can use the concept of "lazy list", its jst load image once and store in cache and dnt reload again and again, so just google it example were given search keyword "lazy list"
Upvotes: 3