Here what i want is i have a fragment inside an Activity and it has a web view which is basically chat to customer service. This activity will be started from a button in another activity,
Now the tricky part is i want to save the current session of the web view so that whenever user comes to this activity or whenever i use this fragment i can show the last conversation as well.
So what i have tried is
private class MyWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
// Saving the last loaded url in shared pref and then loading the same url in oncreateview
return true;
}
}
But when user is having a conversation it is not loading different url thus shouldOverrideUrlLoading is never called.
Help will be highly appriciated