简体   繁体   中英

how to resume webview activity when user comeback

How can I resume a webview activity from same stage it was on. I have a backbutton on Menu when I go to back activity and then come back to webview activity it launchs the same page.

I know its doing because webview loads that url what I give to loadUrl() method. Because activity start onClick() and load webview with loadUrl() method.

I am just a beginner don't know how to use onPause() and onResume() in this case.

As of the question when you click the back button of webview activity the life cycles of the webview activity completes and finishes so it does not resumes the webview when you come back.

Better go through the following blog:

https://developer.android.com/reference/android/app/Activity.html

https://developer.chrome.com/multidevice/webview/gettingstarted

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM