D
D
depew639062021-01-17 15:36:51
Android
depew63906, 2021-01-17 15:36:51

What causes the Unresolved reference: WebViewClient error?

Good afternoon!
MainActivity.kt

package com.example.test

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        webViewSetup()
    }
    private fun webViewSetup() {
        wb_WebView.webViewClient = WebViewClient()

        wb_WebView.apply {
            loadUrl("https://yandex.ru")
        }
    }
}

An error occurs:
MainActivity.kt: (15, 36): Unresolved reference: WebViewClient

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
depew63906, 2021-01-17
@depew63906

import android.webkit.WebViewClient

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question