Restore history and current page on resuming webview
- by qubit
I have a webview that I use to navigate from page to page. I have implemented go back and go forward. My problem is that when I return to the webview after visiting another activity, the history is lost i.e. the webview starts again on the first page.
How do I code it so that after I call finish on the webview to swap to another activity on returning to the webview, the WebBackForwardList is restored and I am taken to the page I was on when I left the webview?
I have tried overriding onSaveInstanceState and onRestoreInstanceState using webview.save/restoreState(bundle) but with no success.
I have achieved returning to the last page by saving the last url in preferences, but have been unable to restore the entire history.