I am new to Android and Kotlin. When I create my own HTML page. I include some links like
<a href='tel:8787878787'>Call our customer service</a>
Finally found ERR_UNKNOWN_URL_SCHEME error. I found the answer here in Java.
Android WebView err_unknown_url_scheme
But I want in Kotlin.
Please help
webViewFeed.webViewClient=object : WebViewClient(){
override fun shouldOverrideUrlLoading(view: WebView?, url: String?): Boolean {
if (URLUtil.isNetworkUrl(url)) {
return false
}
else {
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
startActivity(intent)
}
return true
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.