Mixed adapter: Fragmentpageradapter Fragmentstatepageradapter (fragment data is more dynamic and memory intensive)
Viewpager Pre-load: Viewpager will default to pre-initialize the current page of the left and right adjacent pages, its pre-loaded page number default is 1,
And it is private can not be modified, the advantage is that the left and right sliding will be more fluent.
Lazy loading: That is, let the Viewpager preload the UI, while the specific data, network access requests, and other deferred loading. It's a fragment.
Setuservisiblehint (Boolean Isvisibletouser) method, which we can judge in this method, when its true is visible
(that is, switch to a specific fragment) to load the data, which saves traffic.
Issues that can be resolved:
5 Fragment There is a fragment is surfaceview, so the problem is, I viewpager sliding to its adjacent page, the page containing Surfaceview will be pre-initialized, Then the Surfaceview began to preview, but we could not see it. Similarly, Surfaceview does not call back its Surfacedestory method when we slide down its adjacent page from a page that contains Surfaceview. So it caused me a great deal of trouble.
setoffscreenpagelimit (int limit) to set the number of Viewpager preload
The Viewpager member variable default_offscreen_pages here defines the default value is 1, so there is a solution on the web that calls Viewpager's setoffscreenpagelimit (int limit),
Pre-loading mechanism for integrated use of Viewpager and fragment