IllegalArgumentException: причина Фраза не может быть пустой. только на вкладках и вкладках эмулятора - PullRequest
1 голос
/ 28 января 2020
webView.webViewClient = object : WebViewClientCompat() {
            override fun onReceivedError(view: WebView?, errorCode: Int, description: String?, failingUrl: String?) {
                if (view!!.url.equals(failingUrl)) {
                    toast(getString(R.string.please_try_when_internet_available))
                    webView.clearHistory()
                    webView.loadDataWithBaseURL(null, sHtmlTemplate, "text/html", "utf-8", null)
                }
                super.onReceivedError(view, errorCode, description, failingUrl)
            }

            override fun onReceivedError(view: WebView, request: WebResourceRequest, error: WebResourceErrorCompat) {
                super.onReceivedError(view, request, error)
            }
        }

Это исключение происходит для вышеуказанного набора кода только для вкладок и вкладок эмулятора, которые хорошо работают на устройствах. Также пытались перехватить блоки внутри try-catch и не работают.

...