• 首页
  • 前端技术
  • 编程语言
  • 人工智能
  • 运维知识
  • 资源下载
  • 常用小工具
  • 技术问答

安卓调用js报错webview不在同一线程A WebView method was called on thread 'JavaBridge'. All WebView methods must be called on the same thread

2022-12-23

为js添加一个线程即可

@JavascriptInterface
public void callChangeStartTime(){
runOnUiThread(new Runnable() {
@Override
public void run() {
String call = "javascript:javaca(' 123 ')";
webView.loadUrl(call);
}
});
}

相关文章:

  • Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState] 2021-06-26
  • Flutter 使用 flutter_inappbrowser 加载 H5 及与 js 交互,Methods marked with @UiThread must be executed on the 2022-12-23
  • Can't toast on a thread that has not called Looper.prepare() 2022-12-23
  • iOS Main Thread Checker: UI API called on a background thread的解释 2021-11-05
  • iOS 解决Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState] 2021-05-29
  • Unity线程安全:CompareBaseObjectsInternal can only be called from the main thread 2022-12-23
  • 关于Xcode Main Thread Checker: UI API called on a background 2022-12-23
猜你喜欢
  • [原][Android]All WebView methods must be called on the same thread. 2022-12-23
  • webView.loadUrl 错误:A WebView method was called on thread 'JavaBridge'. 2022-12-23
  • Android-Throwable: A WebView method was called on thread 'JavaBridge'. 2022-12-23
  • 【Android】java.lang.RuntimeException: java.lang.Throwable: A WebView method was called on thread 'JavaBridge 2022-12-23
  • android4.1 JELLY_BEAN:All WebView methods must be called on the same thread[问题已解决] 2021-05-26
  • flutter报错:NoSuchMethodError: The method '>' was called on null. 2021-07-06
  • PhoneFactory.getDefaultPhone must be called from Looper thread 2022-12-23
相关资源
  • android浏览器应用 adnroid webview demo下载 2023-02-04
  • Android开发-WebView与JavaScript交互调用 中文WORD版下载 2023-03-28
  • Android WebView实例详解 中文WORD版下载 2021-07-01
相似解决方案
热门标签
Java Python linux javascript Mysql C# Docker 算法 前端 SpringBoot Redis Vue spring 设计模式 .net core .net kubernetes c++ 数据库 数据结构 大数据 js 机器学习 微服务 Android Go 程序员 面试 JVM ASP.net core 云原生 人工智能 后端 PHP git CSS golang k8s Nginx Django mybatis 深度学习 多线程 React 架构 devops 爬虫 云计算 Spring Boot LeetCode
By © 2026 likecs 版权所有,
本站所有数据收集于网络如有侵犯到您的权益请联系 进行下架处理1。
粤ICP备22038628号Powered By WordPress