Restore history and current page on resuming webview

Posted by qubit on Stack Overflow See other posts from Stack Overflow or by qubit
Published on 2011-01-03T00:57:36Z Indexed on 2011/01/03 3:54 UTC
Read the original article Hit count: 221

Filed under:
|
|
|
|

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.

© Stack Overflow or respective owner

Related posts about android

Related posts about activity