码迷,mamicode.com
首页 > 编程语言 > 详细

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

时间:2016-12-16 01:42:43      阅读:172      评论:0      收藏:0      [点我收藏+]

标签:color   str   was   错误提示   led   thread   cal   stop   void   

 

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+"‘)");
	            }
	        });

 

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

标签:color   str   was   错误提示   led   thread   cal   stop   void   

原文地址:http://www.cnblogs.com/nidongde/p/6185389.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!