Cause by:All WebView methods must be called on the same thread

    项目中使用webview与js进行交互的过程中,重新调用loadurl出现了运行时错误,Cause by:All WebView methods must be called on the same thread ,在js调用后的Java回调线程并不是主线程。导致了程序出现崩溃或提示”程序无法运行“,解决此类异常,将webview操作放在主线程中即可。

代码示例

你可能感兴趣的:(Cause by:All WebView methods must be called on the same thread)