I've a listview with +-250 rows (It's not really usefull, I think, but I had to do it this way). Each row consists of a different logo (in an imageview) and a title (in a textview). Until now I stored my logos in the res/drawable directory, and used the ID's to set the logos:
This works fine.
But now I have to download the logos from a webserver at runtime (because the content of the list isn't always the same) and store them.
So first I downloaded the image to the file directory, then created a drawable like this:
It shows the logos, but after a while (when I'm scrolling through the list) it gives an error:
- Code: Select all
05-19 15:18:52.687: ERROR/dalvikvm-heap(9361): 42976-byte external allocation too large for this process.
05-19 15:18:52.687: ERROR/(9361): VM won't let us allocate 42976 bytes
So it looks like this is not the best way for doing this.
I also tried
this gives an OutOfMemory Exception (maybe I'll ve to add bm.recycle(); somewhere, but I don't know where)
Has someone an idea to solve my problem?