I have created an app opening a website in webView. It was working fine but few days back I'm facing a issue that when a user above android version 6.0 presses a back button webview closes. Searched it on the internet found that webview is disabled in certain android versions? Any Solutions for this? How Can I upgrade / resolve the issue?
Asked
Active
Viewed 332 times
-1
-
3Please provide some piece of code to your issue. – Noel Dec 15 '17 at 14:20
1 Answers
0
You should override your Activity's onBackPressed method, as stated in the docs
@Override
public void onBackPressed() {
if (mWebView.canGoBack()) {
mWebView.goBack();
return;
}
// Otherwise defer to system default behavior.
super.onBackPressed();
}

Ariel Carbonaro
- 1,529
- 1
- 13
- 25