Downloading WebView on Android 5.0 sometimes leads to application jams and crashes

I use WebView to load URLs, and also to send and receive Java script calls.

webView.setWebChromeClient(new WebChromeClient() {
        @Override
        public void onProgressChanged(WebView view, int newProgress) {
            if (newProgress == 100) {
                showContentOrLoadingIndicator(true);
            }
        }

    });

    webView.setWebViewClient(new WebViewClient() {
        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            view.loadUrl(url);
            return true;
        }
     }

The code works fine on android <5, but on versions of lollipop sometimes the application just completely gets stuck and sometimes crashes.

Any idea why?

+4
source share

All Articles