How to save WebView state and restore it in Android Lollipop? -


This question has been asked many times and the answer is used to do the work. Recently, the documentation says that they have removed this facility for security reasons. Only some limited things can be restored for webview status. I have tried many ways to do this, but every time it refreshes the webwave status and does not show webview content.

What do I have to do?

I have a web app that I want to recover user content after a time-out (if they input their credentials right).

 

What have I done so far?

1- I have tried all the solutions including the following solutions:

  Override Protected Zero (Bundle Outstate) at @SaveInstanceState {webView.saveState (outState ); } @ Override Creature (Last Bundle Saved Instantestate) on Public Zero {super.onCreate (savedInstanceState); SetContentView (R.layout.blah); WebView Webview = (webview) Find VVBID (RID webview); If (Saved InstanceState! = Empty) webview.restorestate (savedInstanceState); Also the manifest file  

  Android: configChanges = "keyboardHidden | orientation | screen saver | screen layout | uiMode | Screenscreen 2 - I tried to show my time-out activity as a dialog and if I only dismiss it without evaluating the credentials, but if I evaluate it and reject it, then this webview Rebuilding  

Any help would be appreciated.

Finally I solved There is no way to save the status of the detected webview and to save all the content, so we need to stop reloading the webview or re-creating it. To be an example of our activity in the webview, we will send the following code to our manifest file To add:

   Android: la Unchmode = "singleInstance" Android: alwaysRetainTaskState = "true">  

Then if you want to completely refresh this example to refresh your webview through your application If required, you can use the end (); If this is in activity or if you are in any other activity and you want to revive your webviva activity, then read it to do it.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -