Closed Juanvvc closed 12 years ago
Actually, the ImageSwitcher uses only two views: it is not possible for "the last three pages" to be in memory.
Instead of removing views, I overrided the methods in MyImageView that add a new drawable to recycle old drawables.
When the user changes a page, old views (for example, three pages past) are not unloaded/recycled until that the ImageSwitcher considers that it is necessary. This wastes memory and maybe created additional OutOfMemoryErrors.
Unload/recycle old views that are not going to be used any more. As an alternative, if you detect that the view is available (for example, the view of the last page is almost always available), do not load it again!