随笔 - 159,  文章 - 3,  评论 - 783,  阅读 - 23万

 

1
2
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

 

解决办法

1
2
3
4
5
6
7
webView.post(new Runnable() {
     @Override
     public void run() {
           String voicePath="file://"+MVOICEPATH;
           webView.loadUrl("javascript:voiceStopCallback('"+voicePath+"')");
     }
 });

 

posted on   智华  阅读(1745)  评论(0编辑  收藏  举报

< 2025年1月 >
29 30 31 1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31 1
2 3 4 5 6 7 8
点击右上角即可分享
微信分享提示