我的 Web 视图没有调用它返回警告的 javascript 函数,如下所示。任何人都可以建议如何摆脱以下警告。
07-30 10:15:44.031: W/webview_proxy(3770): java.lang.Throwable: Warning: A WebView method was called on thread 'WebViewCoreThread'. All WebView methods must be called on the UI thread. Future versions of WebView may not support use on other threads.
下面是我的功能。
public boolean onLongClick(View v){
System.out.println("dfdsf");
// Tell the javascript to handle this if not in selection mode
//if(!this.isInSelectionMode()){
this.getSettings().setJavaScriptEnabled(true);
this.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
this.getSettings().setPluginsEnabled(true);
this.loadUrl("javascript:android.selection.longTouch();");
mScrolling = true;
//this.setJavaScriptEnabled(true);
//}
// Don't let the webview handle it
return true;
}