Hi all.
I recently posted asking for help on a method to restore the state of a web page being displayed in a WebView when the device orientation changes.
(http://www.b4x.com/forum/basic4android-updates-questions/9632-pass-values-webpage-application.html)
I'm still looking for a solution (looks like i can use cookies to save the web page's state) but wonder how the native Android browser handles such orientation changes...
I have a ZTE Blade and an Advent Vega and on both devices i can browse to a web page, scroll down a bit (or otherwise change the view so it's not as it would be when the page is first loaded) and then flip the device.
The browser changes orientation and the web page (appears to) remain loaded exactly as it was before the orientation change.
With a WebView in a B4A app the WebView will reload the page - requesting all page elements again - and display the web page as it would display when first loaded.
How does the native browser do this?
Does it have access to properties of the WebView that it saves on actvity pause and restores on activity resume that effectively restore the WebView state (and state of the page displayed)?
Thanks.
Martin.
Edit: I think what i'm asking is - can i get the current HTML DOM structure and state from a WebView and restore that on orientation change?
Nothing in the WebView documentation looks like i can do this.
I recently posted asking for help on a method to restore the state of a web page being displayed in a WebView when the device orientation changes.
(http://www.b4x.com/forum/basic4android-updates-questions/9632-pass-values-webpage-application.html)
I'm still looking for a solution (looks like i can use cookies to save the web page's state) but wonder how the native Android browser handles such orientation changes...
I have a ZTE Blade and an Advent Vega and on both devices i can browse to a web page, scroll down a bit (or otherwise change the view so it's not as it would be when the page is first loaded) and then flip the device.
The browser changes orientation and the web page (appears to) remain loaded exactly as it was before the orientation change.
With a WebView in a B4A app the WebView will reload the page - requesting all page elements again - and display the web page as it would display when first loaded.
How does the native browser do this?
Does it have access to properties of the WebView that it saves on actvity pause and restores on activity resume that effectively restore the WebView state (and state of the page displayed)?
Thanks.
Martin.
Edit: I think what i'm asking is - can i get the current HTML DOM structure and state from a WebView and restore that on orientation change?
Nothing in the WebView documentation looks like i can do this.
Last edited: