Hi again!
As you've discovered - the WebView's
WebBackForwardList is destroyed when the device orientation changes.
Take a look at the documentation for the native WebView
saveState method:
public WebBackForwardList
saveState (Bundle outState)
Can we use the Reflection library to:
In
Activity_Pause:
1) Create a new Bundle.
2) Pass that Bundle to the WebView's saveState method.
3) Save that Bundle (which now contains the WebBackForwardList) as a Process Global.
In
Activity_Create OR
Activity_Resume:
4) Pass the saved Bundle to the WebView's
restoreState method.
I think you'd have to call restoreState in Activity_Create, this is from the documentation:
This method should be called to restore the state of the WebView before using the object. If it is called after the WebView has had a chance to build state (load pages, create a back/forward list, etc.) there may be undesirable side-effects.
Have you got any experience with the Reflection library - i'm not sure what syntax would be used to create a new
Bundle.
Maybe someone else could help with this..?
Martin.