Rewrite Viewpager when calling Getchildat (position) in Viewpager, many of the retrieved view are null
The information was found because I called ((Viewpager) container) when I was instantiateitem. AddView (view);
should be written ((Viewpager) container). AddView (view, position);
Error after operation, index out of bounds
Also check is because the Viewpager inside the default amount of storage is limited, should be viewpager in order to minimize the memory to do so
To make AddView meet my requirements (I need to show 5 pages)
To invoke a Viewpager method
Viewpager.setoffscreenpagelimit (5);
Set the minimum number of pages
That's right when you call Getchildat.
Another way is to create a map to put the created view into this map.
When you need to get the view, get the view through this map get
It's also possible.
My idea is: Anyway, there is no way to save memory in this view.
So just put it in the Viewpager.