Android 中最近设备更新的 Toast 通知问题 [英] Toast Notification issue with recent device update in Android

查看:26
本文介绍了Android 中最近设备更新的 Toast 通知问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这篇文章与现有提交的错误有关:

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:

Nexus 7 平板电脑上未显示 Toast 通知

或在 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.

建议的修复"对我来说很好,但如果我的应用程序被一些不知道如何去做或不想激活通知的人下载怎么办.我在应用程序中非常依赖 toasts 来通知用户一些反馈,所以我只看到一个解决方案:->实现我自己的吐司类,与吐司不同但行为相似.

The suggested "fixes" are fine for me but what if my app is downloaded by some people who don't know how to do that or don't want to activate notifications. I rely on toasts a lot in the app to inform the user about some feedback so I only see one solution to this: ->IMPLEMENT MY OWN TOAST CLASS, different from toast but with similar behaviour.

我四处搜索我还没有找到任何已经完成的东西,所以我问是否有人找到了任何自定义实现(在我自己开始编码之前)?

I have searched around I haven't found anything out there already done so I am asking if anyone has found any custom implementations (before I start coding it myself)?

目标是:即使关闭了此应用的通知,也显示吐司或替代品.

The objective is: show a toast or some replacement for it even if notifications are turned off for this app.

推荐答案

我不知道这是否在所有带有 jelly bean 的设备上都会发生.

I don't know if this happens on all devices with jelly bean or not.

AFAIK,确实如此.

AFAIK, it does.

我在应用中非常依赖 toasts 来通知用户一些反馈

I rely on toasts a lot in the app to inform the user about some feedback

这不是一个好主意.Toast 的生命周期很短,用户很容易错过它们.Toast 适用于简单的咨询/确认消息——以及书籍示例 :-)——但仅此而已.

That is not a good idea. Toasts are very short-lived, and users can easily miss them. Toasts are fine for light advisory/confirmation messages -- and for book examples :-) -- but that's about it.

目标是:即使关闭了此应用的通知,也显示吐司或替代品.

The objective is: show a toast or some replacement for it even if notifications are turned off for this app.

希望您的真正目标是拥有优质的用户体验.依赖 Toast 被看到不会带来高质量的用户体验.

Hopefully, your real objective is to have a quality user experience. Relying on Toasts being seen will not result in a quality user experience.

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 通知问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆