Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- webView.webViewClient = object : WebViewClient() {
- override fun shouldOverrideUrlLoading(view: WebView?, request: WebResourceRequest?): Boolean {
- view!!.loadUrl(request!!.url.toString())
- return true
- }
- override fun shouldInterceptRequest(view: WebView?, request: WebResourceRequest?): WebResourceResponse {
- return if (
- AdBlocker.isAd(request!!.url.toString()))
- AdBlocker.createEmptyResource()
- else
- super.shouldInterceptRequest(view, request)
- }
- override fun onPageStarted(view: WebView?, url: String?, favicon: Bitmap?) {
- eTadres.setText(url)
- suankiurl= url!!
- super.onPageStarted(view, url, favicon)
- }
- override fun onLoadResource(view: WebView?, url: String?) {
- if (webView.visibility==View.GONE){webView.visibility=View.VISIBLE}
- super.onLoadResource(view, url)
- }
- }
- W/System.err: java.lang.IllegalStateException: super.shouldInterceptRequest(view, request) must not be null
- 10-19 17:46:53.185 306-349/com.bulamac.tarayicibulamac W/System.err: at com.bulamac.tarayicibulamac.WebviewFragment$onCreateView$5.shouldInterceptRequest(WebviewFragment.kt:182)
- 10-19 17:46:53.185 306-349/com.bulamac.tarayicibulamac W/System.err: at com.android.webview.chromium.WebViewContentsClientAdapter.shouldInterceptRequest(WebViewContentsClientAdapter.java:52)
- 10-19 17:46:53.185 306-349/com.bulamac.tarayicibulamac W/System.err: at org.chromium.android_webview.AwContents$BackgroundThreadClientImpl.shouldInterceptRequest(AwContents.java:9)
- 10-19 17:46:53.185 306-349/com.bulamac.tarayicibulamac W/System.err: at org.chromium.android_webview.AwContentsBackgroundThreadClient.shouldInterceptRequestFromNative(AwContentsBackgroundThreadClient.java:11)
- 10-19 17:46:53.186 306-349/com.bulamac.tarayicibulamac A/chromium: [FATAL:jni_android.cc(243)] Please include Java exception stack in crash report
- override fun shouldInterceptRequest(view: WebView?, request: WebResourceRequest?): WebResourceResponse? {
- return super.shouldInterceptRequest(view, request)
- }
Add Comment
Please, Sign In to add comment