Hi I am developing an android magazine application.
It has many pictures. In application I show each picture in full screen and the user can swipe between pictures.
I used ViewPager with FragmentStatePagerAdapter. Every thing works fine. When I rotate the device first time it also works fine.
But if I try it several times it give an error. The error is outofmemoryerror.
The adapter for viewpager in horizontal and in portrait is different.
Anybody help what can I do?
If you are using
Bitmaps, the memory held by Bitmap doesn’t get freed by GC, we manually have to release the memory by callingbitmap.recycle().Please see my answer on same issue: bitmap size exceeds Vm budget error android
It has generic answer to this issue.