Skip to content

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

@JorgeAmVF

Description

@JorgeAmVF

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions