Toasts stopped working in 4.4.2

爱⌒轻易说出口 提交于 2019-12-11 03:36:09

问题


In my app Toasts have worked fine until my RazrM phone was upgraded to 4.4.2. then they stopped. I have tried specifically runInUiThread and moving the call to initiate from different places in the code including in onCreate(). The issue [20373751] (Toast not appearing on Android 4.4 KitKat) proposes rebooting or specifically running on the UI thread. Neither makes a difference.

That issue also questions if there is a bug in Nexus or KitKat. I have the Toasts running fine in 4.0.4 on a Samsung Galaxy Tab. So I am thinking the problem is in 4.4. Has anyone found a workaround? (BTW I am compiling to a target of Version 9, so it is not an issue with the compile level.But I am using the infamous 23.0.2 SDK.) Can anyone prove that Toasts work under 4.4.2 while using SDK 23.0.2?


回答1:


In [21098062] @marcin_j said:

On Jelly Bean 4.1 or higher,you can disable apps notifications from device settings. Just open notification bar, long tap on any of notifications and click App Info, you should see “Show notifications”. Unchecking this option should disable toasts in your app.

If your app does not show any notifications, then you should be able to reach App Info screen from applications manager.

Maybe this is the cause of you missing toasts


This was absolutely correct. My 4.0.4 device was not affected but my 4.4.2 device had had Show notifications unchecked.



来源:https://stackoverflow.com/questions/25507416/toasts-stopped-working-in-4-4-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!