Basically what the name says,
My application consists mainly of a ViewPager that uses a FragmentStatePagerAdapter
The problem occurs when I add a series of SurfaceViews to the FragmentStatePagerAdapter. Just for testing purposes, I did not subclass SurfaceViews in any way. When I move through several pages, hit "home", and then return to activity, the whole device freezes for a second or two before rendering anything. I can start and end () the application several times during the time it takes to resume after it has been removed from the back. I know the application is running because several AsyncTasks are almost done by the time the first screendraw is complete. I know that these AsyncTasks do not cause problems because I deleted them without effect.
When I change SurfaceViews to Views , the problem completely disappears.
This problem occurs when I use my actual SurfaceViews (which are not negotiable for my project). This issue also occurs on multiple devices.
At this point, I think the error lies directly with the ViewPager, but I donβt know what to do with it, because I need this interface component.
Any help would be greatly appreciated!
EDIT:
To clarify, SurfaceViews / Views represent a view of the fragment added to the FragmentStatePagerAdapter.
source share