Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Toast Notification issue with recent device update in Android

This post is related to the existing filed bug:

https://groups.google.com/forum/#!topic/android-developers/K7pjy3Gm5Lk/discussion

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:

Toast Notifications Not Showing Up on Nexus 7 Tablet

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.

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.

like image 279
vallllll Avatar asked Oct 06 '22 04:10

vallllll


1 Answers

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

AFAIK, it does.

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

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.

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

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.

like image 153
CommonsWare Avatar answered Oct 10 '22 01:10

CommonsWare