Wednesday, 15 May 2013

Android: How to restore webview when switching among activities? -



Android: How to restore webview when switching among activities? -

i have webview in activity , i'm navigating activity b, when switch activity want restore webview, i.e., reload recent url , can go backward view history.

my problem reset webview null when activitya.onpause() gets called avoid memory leak, have problem restoring when activitya.onresume() gets called since design have create new webview instance. way if can restore latest url can't restore history.

any advice appreciated!

dirty one, have save info on onpause() method maybe in preferences, , retrieve info preference on onresume() method , set info webview.

another way solve problem utilize activityforresult.

android webview restore

No comments:

Post a Comment