[android-developers] Re: How to manage severla bitrmap for a ListView avoiding OutOfMemory?

2010-11-18 Thread Paolo
Thanks Victor, for your answer, but the adapter alone doesn't solve my problem. The softreference is cleared, by definition, when the system needs memory, not when then objects looses all the references. Thanks to Streets of Boston too, I haven't thounght about your solution with LinkedHashMap, ov

[android-developers] Re: How to manage severla bitrmap for a ListView avoiding OutOfMemory?

2010-11-17 Thread Streets Of Boston
Use a LinkedHashmap for a cache and implement the method 'removeEldestEntry(...)' appropriately to limit the cache-size. If the LinkedHashmap cache contains your image, code the 'getView(...)' of your list-adapter to immediately assign the (thumbnail) image to the image-view. If the LinkedHashmap

[android-developers] Re: How to manage severla bitrmap for a ListView avoiding OutOfMemory?

2010-11-17 Thread viktor
for the 2d problem, a list adapter works thus. for the 1t problem, yes, exactly, if you are using correct list adapter, after first initialization view object is repeat, reference to first bitmap will be reassigned. Thats why GC deallocate first bitmap, has no reference to that. On 17 Лис, 15:50