0

Android Webview shouldOverrideUrlLoading method not working Android 10 and onwards, when a click triggered for anchor tag href link, which is a valid URL. The below code is working fine for android 8 and 9, where it gets called. The override gets called, but not on android10 onwards. The new request based shouldOverrideUrlLoading(WebView, WebResourceRequest) is also working fine on Android 8 and 9, except android 10 and onwards. Tried to check release notes and it deidn't help.

@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
    view.loadUrl(url);
    return false;
}
Sun
  • 1
  • 3
  • You can use shouldOverrideUrlLoading(WebView, WebResourceRequest) instead of shouldOverrideUrlLoading(WebView view, String url) – Muhammad Ahmed Nov 19 '21 at 19:59
  • same behavior with shouldOverrideUrlLoading(WebView, WebResourceRequest). – Sun Nov 19 '21 at 20:38
  • Something got changed for webview or webviewclient in android 10 that is giving this issue. – Sun Nov 20 '21 at 00:46
  • Looks like Android System Webview got changed from Android 9 to Android 10, which made a big difference how things are managed. – Sun Nov 23 '21 at 22:46

0 Answers0