StateManager does not seem to save & restore the states of views inside AHViewPager and the AHViewPager itself. How do I modify StateManager so that it does?
Tried making StateManager access AHPageContainer's panel, but AHPageContainer isn't a part of the Activity. Meanwhile, the AHViewPager, which is added to the Activity, does not seem to provide a way to access its AHPageContainer.
You can get the AHPageContainer object from a Viewpager with this little helper sub (with the use of JavaObject):
Code:
Sub GetPageContainer (vpg AsAHViewPager) AsAHPageContainerDim jo AsJavaObject
jo = vpgReturn jo.RunMethod("getAdapter", Null)End Sub
If you get this working I would be very interested in your changes/additions to the Statemanager code.
It is possible to modify the buffering of the ViewPager so it won't only create one page left and right of the current one but it can create more.
For setting this offset to a higher value see this post.
In the android documentation is a hint that this value should be kept as low as possible. So I would not recommend to set it very high.
So saving the state may be possible for 3-4 pages but for more they should be regenerated (that's what I do in my apps always)