Android-Throwable: A WebView method was called on thread 'JavaBridge'.


錯誤詳情:

01-30 03:36:52.441 12000-12048/cn.h5 D/@@@: e.ttt:java.lang.RuntimeException: java.lang.Throwable: A WebView method was called on thread 'JavaBridge'. All WebView methods must be called on the same thread. (Expected Looper Looper (main, tid 1) {18b9c7c8} called on Looper (JavaBridge, tid 481) {789820c}, FYI main Looper is Looper (main, tid 1) {18b9c7c8})

 

 

當出現以上錯誤后,處於阻塞狀態,無任何效果,出現此錯誤的原因是:

webView.loadUrl("javascript:show(" + json + ")");

 

解決方法:

runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                       
                        webView.loadUrl("javascript:show(" + json + ")");
                    }
                });

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM