java.lang.RuntimeException: java.lang.Throwable: A WebView method was called on thread 'WeexJSBridgeThread'. All WebView methods must be called on the same thread. (Expected Looper Looper (main, tid 1) {7b5f50f} called on Looper (WeexJSBridgeThread, tid 421) {e2ad507}, FYI main Looper is Looper (main, tid 1) {7b5f50f});at io.dcloud.common.adapter.ui.WebViewImpl.loadUrl
这个问题如何解决
zopen (作者)
var currentWebview = this.$mp.page.$getAppWebview() //获取当前页面的webview对象
// 当前Webview对象的实例
var wv = currentWebview.children()[0].nativeInstanceObject();
var Runnable = plus.android.implements("java.lang.Runnable",{
run:function(){
console.log("sassssssssssssssssssssssssssssss");
let webViewProvider = wv.getWebViewProvider();
console.log(webViewProvider)
var PrintAttributes = plus.android.importClass('android.print.PrintAttributes');
var printBuilder = new PrintAttributes.Builder();
printManager.print('jaobnema', plus.android.invoke(wv,"createPrintDocumentAdapter"), printBuilder.build());
}
})
console.log(main);
var webview = plus.android.currentWebview();
console.log(webview);
main.runOnUiThread(Runnable);
2019-06-24 21:18
zopen (作者)
我想调用系统打印功能报的
2019-06-24 21:18
zopen (作者)
java.lang.RuntimeException: java.lang.Throwable: A WebView method was called on thread 'WeexJSBridgeThread'. All WebView methods must be called on the same thread. (Expected Looper Looper (main, tid 1) {4669fa5} called on Looper (WeexJSBridgeThread, tid 449) {4b5017b}, FYI main Looper is Looper (main, tid 1) {4669fa5});at io.dcloud.common.adapter.ui.WebViewImpl.createPrintDocumentAdapter
2019-06-24 21:19
zopen (作者)
nativejs,执行webview下的方法都会报这个问题
2019-06-24 21:22
1***@qq.com
这问题无解吗?
2019-07-22 22:23