I am trying to save loaded page values ββand javascript WebView when changing orientation and pausing. At first I tried to override configChanges, but this led to my GUI not updating properly (I have a sliding frame that changes position when changing orientation). After that, I tried to put the WebView in the fragment and call setRetainInstance (true); But this does not prevent the retention of WebView content. I tried to save the same object without recreating it, but android does not allow reusing views.
my question is: is there a way to save the contents of the web view without having to reload it every time the orientation changes, while the other components of the GUI will be updated correctly.
I hope my question is clear enough, but I would be happy to work out if there are any strange things.
EDIT: I already tried adding android: configChanges = "keyboardHidden | orientation" in my manifest, this is what I meant by "overriding configurations"
It seems the only solution is to update all javascript variables again when the orientation changes. Since I have not yet run huge chunks of updates through javascript, I cannot give much information about the speed and resources of this operation.
source
share