android-kotlin-webview icon indicating copy to clipboard operation
android-kotlin-webview copied to clipboard

"Overrides deprecated member in 'android.webkit.WebViewClient'"

Open JorgeAmVF opened this issue 7 years ago • 0 comments

This inspection reports deprecated members being overridden.

        override fun shouldOverrideUrlLoading(view: WebView, url: String): Boolean {
            if (Uri.parse(url).host == getString(R.string.website_domain)) {
                return false
            }
            val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
            startActivity(intent)
            return true
        }

The method above was deprecated in API level 24 and must be covered by the one below which:

Give the host application a chance to take over the control when a new url is about to be loaded in the current WebView.

shouldOverrideUrlLoading(WebView view, WebResourceRequest request)

JorgeAmVF avatar Jan 03 '18 16:01 JorgeAmVF