java 动态代理 阿bin_Android WebView 的方法只能在 UI 线程中运行
Android WebView 的方法只能在 UI 線程中運行
Android,WebView,線程
2018.04.25
根據報錯信息,Android 的 WebView 所有的方法都只能在 UI 線程中調用,在非 UI 線程調用都會產生一些意外的崩潰。
今天分析收集到的崩潰日志,看到一下的一些日志信息。發生的機型主要集中在 4.3 的機型中。很奇怪在更高的版本中,并沒有發現這樣的問題。記錄一下,以備后續觀察。
通過日志可以看出,所有的 WebView 方法都只能在 UI 線程中被調用。
java.lang.RuntimeException: java.lang.Throwable: Warning: A WebView method was called on thread 'WebViewCoreThread'. All WebView methods must be called on the UI thread. Future versions of WebView may not support use on other threads.
at android.webkit.WebView.checkThread(WebView.java:2093)
at android.webkit.WebView.loadUrl(WebView.java:836)
at com.binkery.android.utils.webviewbridge.Bridge.executeJavascript(Bridge.java:260)
at com.binkery.android.utils.webviewbridge.Bridge.executeJavascript(Bridge.java:229)
at com.binkery.android.utils.webviewbridge.Bridge.dispatchMessage(Bridge.java:113)
at com.binkery.android.utils.webviewbridge.Bridge.queueMessage(Bridge.java:100)
at com.binkery.android.utils.webviewbridge.Bridge.access$300(Bridge.java:25)
at com.binkery.android.utils.webviewbridge.Bridge$2.callback(Bridge.java:202)
at com.binkery.android.webview.AbsMethod.doResponse(AbsMethod.java:48)
at com.binkery.android.webview.methods.MethodVolunteer.downResponse(MethodVolunteer.java:43)
at com.binkery.my.volunteer.DownQRSaveUtil$1.handleMessage(DownQRSaveUtil.java:35)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:1092)
at java.lang.Thread.run(Thread.java:841)
Caused by: java.lang.Throwable: Warning: A WebView method was called on thread 'WebViewCoreThread'. All WebView methods must be called on the UI thread. Future versions of WebView may not support use on other threads.
at android.webkit.WebView.checkThread(WebView.java:2084)
... 14 more
java.lang.Throwable: Warning: A WebView method was called on thread 'WebViewCoreThread'. All WebView methods must be called on the UI thread. Future versions of WebView may not support use on other threads.
at android.webkit.WebView.checkThread(WebView.java:2084)
at android.webkit.WebView.loadUrl(WebView.java:836)
at com.binkery.android.utils.webviewbridge.Bridge.executeJavascript(Bridge.java:260)
at com.binkery.android.utils.webviewbridge.Bridge.executeJavascript(Bridge.java:229)
at com.binkery.android.utils.webviewbridge.Bridge.dispatchMessage(Bridge.java:113)
at com.binkery.android.utils.webviewbridge.Bridge.queueMessage(Bridge.java:100)
at com.binkery.android.utils.webviewbridge.Bridge.access$300(Bridge.java:25)
at com.binkery.android.utils.webviewbridge.Bridge$2.callback(Bridge.java:202)
at com.binkery.android.webview.AbsMethod.doResponse(AbsMethod.java:48)
at com.binkery.android.webview.methods.MethodVolunteer.downResponse(MethodVolunteer.java:43)
at com.binkery..DownQRSaveUtil$1.handleMessage(DownQRSaveUtil.java:35)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:1092)
at java.lang.Thread.run(Thread.java:841)
相關文章
- EOF -
本站文章除注明轉載外,均為本站原創或編譯。歡迎任何形式的轉載,但請務必注明出處,尊重他人勞動。
轉載請注明:文章轉載自 Binkery 技術博客 [https://binkery.com]
本文標題: Android WebView 的方法只能在 UI 線程中運行
本文地址:https://binkery.com/archives/112002.html
總結
以上是生活随笔為你收集整理的java 动态代理 阿bin_Android WebView 的方法只能在 UI 线程中运行的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 合作破裂?传华为研发人员撤离赛力斯 官方
- 下一篇: android 静态广播无效,Andro