Blankj / AndroidUtilCode

:fire: Android developers should collect the following utils(updating).
https://blankj.com/2016/07/31/android-utils-code/
Apache License 2.0
33.24k stars 10.67k forks source link

ToastUtil在魅族手机不显示问题 #957

Closed LXLYHM closed 5 years ago

LXLYHM commented 5 years ago

Describe the bug

最新版本1.24.2的ToastUtil在魅族手机不显示:ToastUtils.showShort("hello"); 机型名称:M1822 设备型号:M822Q Android版本:8.1.0 版本号:Flyme 7.3.0.0A A clear and concise description of what the bug is.

The code of bug

put your code here

The stack of crash

put the stack of crash here

Screenshots

If applicable, add screenshots to help explain your problem.

Please delete the current line and the followings.

Thank you for supporting AndroidUtilCode.

Blankj commented 5 years ago

https://github.com/Blankj/AndroidUtilCode/releases/download/1.24.2/util_1_24_2.apk 跑我这个 demo 呢

LXLYHM commented 5 years ago

跑你这个demo能弹

我自己的同一个项目 classpath 'com.android.tools.build:gradle:3.1.0' distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip ToastUtils在魅族这把手机能弹窗 但是 classpath 'com.android.tools.build:gradle:3.3.1' distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip ToastUtils在这把魅族手机就不弹窗了额 好奇怪 这跟我之前AndroidUtilCode都用1.9.1版,忽然升级到1.24.2版有影响吗?

Blankj commented 5 years ago

和 gradle 无关的,你要确保用的是 1.24.2 的包那就可以的,看一下 gradle 依赖关系,最终是否是 1.24.2

LXLYHM commented 5 years ago

嗯,最终确实是导入1.24.2的版本。 排查出来原因: 请求返回错误时连续调用ToastUtils三次 弹相同或不同提示内容的时候 弹不出来 我改成请求错误只弹一次提示内容 魅族那把手机就ok了 别的手机都不会因为连续弹多次有问题(⊙o⊙)…

LXLYHM commented 5 years ago

感谢大佬抽空指点