Recycling views in scrollview in android
I have scrollview
one in which I inflated the view dynamically (just like the facebook wall android app, it has imageview
and textview
.).
All images are dynamic. If I load too much data into it I get outofmemory exception
. I know it listview
will solve my problem, but I cannot use listview
.
So, is there a way to optimize ie to recycle views when they are not visible?
source to share
From your comments, I believe you can still use the list view:
The list can take many different forms. For more information on this, read Android ListView with different layouts for each row .
This way the views will be reworked and hopefully your memory usage will be less.
Anyway , I would probably investigate your code as I suppose you are probably leaking objects or doing something too many times to run out of memory.
source to share