Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ToastUtil 在华为平板7.0的系统上有问题,会引起其他控件的错误 #675

Closed
glmsb opened this issue Oct 19, 2018 · 23 comments

Comments

@glmsb
Copy link

glmsb commented Oct 19, 2018

2018-10-19 10:50:38.291 9028-9028/com.tendao.rushrepair E/InputEventReceiver: Exception dispatching input event.
2018-10-19 10:50:38.291 9028-9028/com.tendao.rushrepair E/MessageQueue-JNI: Exception in MessageQueue callback: handleReceiveCallback
2018-10-19 10:50:38.296 9028-9028/com.tendao.rushrepair E/MessageQueue-JNI: android.content.res.Resources$NotFoundException: Drawable android:drawable/text_select_handle_middle_material with resource ID #0x1080761
Caused by: android.content.res.Resources$NotFoundException: File res/drawable/text_select_handle_middle_material.xml from drawable resource ID #0x1080761
at android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:935)
at android.content.res.ResourcesImpl.loadDrawable(ResourcesImpl.java:769)
at android.content.res.Resources.getDrawable(Resources.java:834)
at android.content.Context.getDrawable(Context.java:529)
at android.widget.Editor$InsertionPointCursorController.getHandle(Editor.java:5221)
at android.widget.Editor$InsertionPointCursorController.show(Editor.java:5200)
at android.widget.Editor.onTouchUpEvent(Editor.java:2196)
at android.widget.TextView.onTouchEvent(TextView.java:8854)
at android.view.View.dispatchTouchEvent(View.java:10013)

@Blankj
Copy link
Owner

Blankj commented Oct 19, 2018

为什么不按照 issue 模板来提,还得问用的我的库是什么版本?

@glmsb
Copy link
Author

glmsb commented Oct 19, 2018

尴尬了,,用的是1.1.3版本

@Blankj
Copy link
Owner

Blankj commented Oct 19, 2018

试试最新版本吧 1.21.0 哈

@glmsb
Copy link
Author

glmsb commented Oct 19, 2018

好的,稍等

@glmsb
Copy link
Author

glmsb commented Oct 19, 2018

还是不行,一样的问题,我在其他手机,魅族和联想手机上面试了都没有问题的,还有就是我用原生的Toast和其他第三方的Toast在这个华为手机平板上也是没有问题的

@glmsb
Copy link
Author

glmsb commented Oct 19, 2018

顺便我想问一下这个库里面是否有实时监听网络变化的工具类?

@Blankj
Copy link
Owner

Blankj commented Oct 19, 2018

这需要你自己实现广播哦,然后可以调用 networkutils 来判断网络状态

@glmsb
Copy link
Author

glmsb commented Oct 19, 2018

但是监听网络的广播貌似在7.0之后就不起作用了,官方做了限制,有没有其他实现思路,请教一下

@Blankj
Copy link
Owner

Blankj commented Oct 19, 2018

这我不太清楚哈,我现在不怎么做业务的,所以不是很清楚

@Blankj
Copy link
Owner

Blankj commented Oct 19, 2018

你在 dispatchTouchEvent 里 showToast? 你这不是分分钟报表? 在 dispatchTouchEvent 里打 log,用户提示才用 toast

@Blankj
Copy link
Owner

Blankj commented Oct 19, 2018

看样子你是个新手吧

@glmsb
Copy link
Author

glmsb commented Oct 19, 2018

谢了哈

@glmsb
Copy link
Author

glmsb commented Oct 19, 2018

没有的事情,,直接在onCreat里面showToast的,这时应用还没有报错,但是当我触摸其他控件的时候就报错了,其他手机正常

@Blankj
Copy link
Owner

Blankj commented Oct 19, 2018

@glmsb
Copy link
Author

glmsb commented Oct 19, 2018

demo跑起来了没有问题

@glmsb
Copy link
Author

glmsb commented Oct 19, 2018

你试试在页面上有TextInputLayout,TextInputEditText控件的时候弹toast,然后去触摸上面的控件试试

@Blankj
Copy link
Owner

Blankj commented Oct 19, 2018

我没有你的平板,测试不了哈,toast 怎么会和其他控件有关系呢,这不合逻辑,你再看看你哪里调用了我的 ToastUtils

@glmsb
Copy link
Author

glmsb commented Oct 19, 2018

我也很纳闷啊,,改成原生的就行,我在Activity、Fragment和service中都有调用你的ToastUtils,,测试发现主要影响的控件是Material中的控件

@Blankj
Copy link
Owner

Blankj commented Oct 19, 2018

那你就保留你需要测试的地方的代码,其他都注释掉试试。或者你新建个 demo 测下看有没有问题。

@glmsb
Copy link
Author

glmsb commented Oct 19, 2018

新建了demo,测试没有问题,汗,估计是哪个库的资源出问题,,只能暂时先用原生的Toast了

@Blankj
Copy link
Owner

Blankj commented Oct 19, 2018

用了 QMUI 吗

@Blankj Blankj closed this as completed Oct 22, 2018
@glmsb
Copy link
Author

glmsb commented Oct 22, 2018

是的

@Blankj
Copy link
Owner

Blankj commented Oct 22, 2018

那就是 QMUI 的问题 #660

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants