问题描述
这篇文章与现有提交的错误有关:
This post is related to the existing filed bug:
https://groups.google.com/forum/#!topic/android-developers/K7pjy3Gm5Lk/discussion
显然,在系统更新后的某些设备中,不会显示吐司.问题发生在首选项中,对于您的应用程序,未选中通知复选框.因此,您的应用程序的所有吐司都将被隐藏.这发生在我的三星 Galaxy Tab 2 上,但它可能发生在其他设备上:
Apparently, in some devices after a system update, the toasts are not shown. The problem happens when in preferences, for your application the notifications checkbox is unchecked. Due to that your all the toasts of your app will be hidden.This happened to me on a Samsung galaxy tab 2 but it can happen on other devices:
或在 SGS3 上如在 google group 链接上评论的那样.
or on SGS3 as commented on the google group link.
I don't know if this happens on all devices with jelly bean or not.
我四处搜索我还没有找到任何已经完成的东西,所以我问是否有人找到了任何自定义实现(在我自己开始编码之前)?
推荐答案
这不是一个好主意.Toast 的生命周期很短,用户很容易错过它们.Toast 适用于简单的咨询/确认消息——以及书籍示例 :-)——但仅此而已.
希望您的真正目标是拥有优质的用户体验.依赖 Toast
被看到不会带来高质量的用户体验.
Toast
也因其他原因失宠,例如它们独立于底层活动,因此显示的 Toast
可能不是如果用户已经在应用程序中的其他地方导航,则相关.领先的替换实现称为面包片",基于一个术语Cyril Mottier 在博客文章中使用,有几个开源实现,例如这个.
Toasts
have fallen out of favor for other reasons as well, such as the fact that they are independent of the underlying activity, and so a displayed Toast
may not be relevant if the user has already navigated elsewhere in the app. The leading replacement implementation is called a "crouton", based upon a term used by Cyril Mottier in a blog post, with a couple of open source implementations, such as this one.
这篇关于Android 中最近设备更新的 Toast 通知问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!