错误

运行android项目 控制台报错
android.util.AndroidRuntimeException: Animators may only be run on Looper threads

详细错误

2022-09-20 09:58:53.144 5868-6007/com.example.electronicmall E/AndroidRuntime: FATAL EXCEPTION: OkHttp DispatcherProcess: com.example.electronicmall, PID: 5868android.util.AndroidRuntimeException: Animators may only be run on Looper threadsat android.animation.AnimatorSet.start(AnimatorSet.java:705)at android.animation.AnimatorSet.start(AnimatorSet.java:684)at android.animation.StateListAnimator.start(StateListAnimator.java:188)at android.animation.StateListAnimator.setState(StateListAnimator.java:181)at android.view.View.drawableStateChanged(View.java:22948)at android.widget.TextView.drawableStateChanged(TextView.java:5927)at android.view.View.refreshDrawableState(View.java:23003)at android.view.View.dispatchAttachedToWindow(View.java:20139)at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3626)at android.view.ViewGroup.addViewInner(ViewGroup.java:5404)at android.view.ViewGroup.addView(ViewGroup.java:5190)at android.view.ViewGroup.addView(ViewGroup.java:5130)at android.view.ViewGroup.addView(ViewGroup.java:5103)at com.example.electronicmall.test.User.UserMineActivity$1$1.onResponse(UserMineActivity.java:141)at com.squareup.okhttp.Call$AsyncCall.execute(Call.java:168)at com.squareup.okhttp.internal.NamedRunnable.run(NamedRunnable.java:33)at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)at java.lang.Thread.run(Thread.java:929)

解决方案

原因

对于所创建的线程, 若代码涉及页面UI更改。根据android官网规定, 为确保程序安全, 需放置 runOnUiThread类型的线程中。

原创不易
转载请标明出处
如果对你有所帮助 别忘啦点赞支持哈

E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher android.util.AndroidRuntimeException: Animators相关推荐

  1. AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher

    今天使用OkHttp的时候遇到一个坑,加了句log后就报错 Log.d(TAG, "onResponse: "+ response.body().string()); String ...

  2. android OKhttp 异常之: FATAL EXCEPTION: OkHttp Dispatcher

    网络请求的时候 莫名其妙报一个错: FATAL EXCEPTION: OkHttp Dispatcher 调用的代码: Log.e(TAG, "response::" + resp ...

  3. 12-10 11:05:55.176 8754-8796/ndk_demo.cyh.com.okhttp3demo E/AndroidRuntime: FATAL EXCEPTION: OkHttp

    OkHttp3连接接口时报错FATAL EXCEPTION: OkHttp Dispatcher - 代码先锋网

  4. FATAL EXCEPTION: OkHttp Dispatcher错误

    报错时间: 2019-1-2 是否自己原因: 是 错误位置: 在OkHttp的onResponse方法 @Overridepublic void onResponse(Call call, Respo ...

  5. android logcat里面AndroidRuntime FATAL EXCEPTION: main这个是什么问题啊。

    android logcat里面AndroidRuntime FATAL EXCEPTION: main这个是什么问题啊. http://zhidao.baidu.com/link?url=mUI11 ...

  6. android.util.AndroidRuntimeException: requestFeature() must be called before adding content

    问题 Caused by: android.util.AndroidRuntimeException: requestFeature() must be called before adding co ...

  7. android错误-android.util.AndroidRuntimeException:You cannot combine custom titles with other title

    报如下错误:android.util.AndroidRuntimeException: You cannot combinecustom titles with other title feature ...

  8. Caused by: android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity

    Caused by: android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity ...

  9. 报如下错误:android.util.AndroidRuntimeException: You cannot combine custom titles with other title featur

    解决方法: 后来,我直接在 AndroidManifest.xml 中,将android:theme="@style/AppTheme" 直接改成android:theme=&qu ...

最新文章

  1. android onresume时view,android – 在使用ViewPager滑动时,Fragment不会调用OnResume()
  2. 访问者模式用到了一种双分派的技术——静态分派和动态分派
  3. ASP.NET MVC5+EF6+EasyUI 后台管理系统(40)-精准在线人数统计实现-【过滤器+Cache】...
  4. 运算器(串行加法器和并行加法器,ALU)
  5. 一起学Windows Phone 7开发(九.Windows Phone Developer Tools Beta)
  6. weblogic mysql数据源配置文件_通过weblogic数据源实现配置oracle and mysql方法
  7. SpringBoot(1.5.6.RELEASE)源码解析(三)
  8. C#读写文本文件,字符串截取
  9. ubuntu 14.04 将用户目录下中文目录修改为英文目录
  10. Python爬虫用到的一些浏览器代理标识
  11. 多视图几何三维重建实战系列之COLMAP
  12. 【spring】JDK动态代理的使用与源码分析
  13. python 余弦值_余弦相似度
  14. Nodejs版本更新
  15. java用于选择结构的关键字_Java结构
  16. Win7 + VirtualBox 安装 MacOS X 10.9 Mavericks 操作步骤
  17. storm windows 机制
  18. 中国一汽发布L4级智能驾驶技术,解放商用车率先使用;科大讯飞今日将发翻译机2.0版本;阿里巴巴已以50亿控股全球第二大WiFi芯片商乐鑫信息科技
  19. 2019年胡润百富榜发布,比特大陆创始人詹克团成「中国区块链首富」!
  20. 在s5pv210开发板上移植官方2101310版本的uboot

热门文章

  1. 美创科技入选“2022年度杭州市人工智能重大科技创新项目”计划
  2. javascript打飞机程序8x8x飞机大战js打飞机程序,飞机大战知识点包含了JavaScript面向过程的全部知识点,包括变量、运算符、判断、循环、数组、自定义函数、系统函数、事件等。...
  3. 开源软件《M8围棋谱》v0.8.8 首次登陆魅族软件中心,免费发布,技术总结
  4. Exploit Pack 漏洞利用工具包
  5. 【HBase数据开发】集群搭建NameNode未格式化
  6. 关于微信APP支付,提示支付验证签名失败
  7. 下载S1的ROM的地方
  8. 怎么测试直播类产品……
  9. gdp python 变迁动图_用 Python 带你看各国 GDP 变迁|python3教程|python入门|python教程...
  10. 网易邮箱发送验证短信的工具类