Android Question Copying State Between Webviews

DawningTruth

Active Member
Licensed User
I am using a bundle to copy state from Webview1 to Webview2. Here is the "paste" code:

B4X:
Dim jo As JavaObject = myWebview
jo.RunMethod("restoreState", Array(myBundle))
This code compiles, but does not actually paste the new state into Webview2. Webview2 retains its old state.

I presume I need to reset or initialize WebView2. I have tried both initializing and invalidating WebView2. But it still does not work. Any suggestions?
 

DawningTruth

Active Member
Licensed User
I am using a bundle to copy state from Webview1 to Webview2. Here is the "paste" code:

B4X:
Dim jo As JavaObject = myWebview
jo.RunMethod("restoreState", Array(myBundle))
This code compiles, but does not actually paste the new state into Webview2. Webview2 retains its old state.

I presume I need to reset or initialize WebView2. I have tried both initializing and invalidating WebView2. But it still does not work. Any suggestions?
Resolved. I had to create a new WebView from scratch. Then it worked.
 
Top