Kotlin在webview中遇到的问题

在使用Kotlin时,重写WebView的WebViewClient
在运行时onPageStarted()会发生奔溃,在错误日志如下:

Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter favicon

解决方案

override fun onPageStarted(view: WebView, url: String, favicon: Bitmap?) {
    super.onPageStarted(view, url, favicon)
    xxxx
}

在重写onPageStarted()方法时 注意把favicon这个参数置为可空的

你可能感兴趣的:(Kotlin在webview中遇到的问题)