java.lang.RuntimeException: java.lang.Throwable: A WebView method was called on thread 'JavaBridge'.

版权声明: https://blog.csdn.net/shoneworn/article/details/81030678

出现上面报错,说明,你在其他线程中操作了webview。

比如webview.loadurl("javasript:***")

这个是想怎么办?

如果方便,你可以直接runOnMainThread 加上去。如果不方便。那就抛给主线程处理

Handler mainHandler = new Handler(Looper.getMainLooper);

mainHandler.post( new Runnable{

    run(){

        webview.loadurl("javasript:***")

    }

});

提供思路。具体代码自己撸上去。


猜你喜欢

转载自blog.csdn.net/shoneworn/article/details/81030678