webView.loadUrl 错误:A WebView method was called on thread 'JavaBridge'.

String voicePath="file://"+MVOICEPATH;
webView.loadUrl("javascript:voiceStopCallback('"+voicePath+"')");

日志错误提示:

A WebView method was called on thread 'JavaBridge'. All WebView methods must be called on the same thread

解决办法

		   webView.post(new Runnable() {
@Override
public void run() {
String voicePath="file://"+MVOICEPATH;
webView.loadUrl("javascript:voiceStopCallback('"+voicePath+"')");
}
});
上一篇:我的Modbus Slave/Client开发历程(Rtu/AscII/Tcp)


下一篇:Unity3D用vistual studio打卡C#脚本卡死解决