Question

I have an Activity that has a single ImageView on it, but it swaps the resourse out many times, cycling through several different high-resolution images.

I've been running into trouble with with "Bitmap Size Exceeds VM Budget" error. I've seen posts on here about manually cleaning things up in the onDestroy method, but the activity doesn't always get that far.

What can I do to cycle through a lot of big images without running out of memory?

Was it helpful?

Solution

I suggest recycle the bitmap of the imageView in onPause() method, and in onResume() load the image again.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top