Issue
I have a webview application, and I need to refresh(using webview.Reload()) the webview whenever the app has been running in the background (has not been killed) and is brought back.How would I do that?
Solution
As a user navigates through, out of, and back to your app, the Activity instances in your app transition through different states in their lifecycle. The Activity class provides a number of callbacks that allow the activity to know that a state has changed: that the system is creating, stopping, or resuming an activity, or destroying the process in which the activity resides.
@Override
public void onResume() {
super.onResume();
webView.reload();
}
https://developer.android.com/guide/components/activities/activity-lifecycle
Answered By - JakeB
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.