Toast does not appear on Samsung Galaxy S3 (latest update 4.1.2)

I have a toast that displays as follows:

Toast.makeText(context, "The message", Toast.LENGTH_LONG).show(); 

I am absolutely sure that I am showing the toast from the UI thread, and I can add that it worked fine for many devices, including older Galaxy S3 updates, but after the last update, none of my toasts are displayed.

Has anyone else experienced this and have a solution?

+8
android samsung-mobile toast galaxy
source share
2 answers

In newer Android phones, there is a “Show notifications” checkbox in the application settings, and for some reason, if notifications are disabled, it also disables toasts. The issue was reported here:

http://code.google.com/p/android/issues/detail?id=35013

But looking at the source code:

https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/services/java/com/android/server/NotificationManagerService.java

it seems like this may be intentional:

Line 114:

 private static final boolean ENABLE_BLOCKED_TOASTS = true; 

Lines 693-707:

 final boolean isSystemToast = ("android".equals(pkg)); if (ENABLE_BLOCKED_TOASTS && !isSystemToast && !areNotificationsEnabledForPackageInt(pkg)) { Slog.e(TAG, "Suppressing toast from package " + pkg + " by user request."); return; } 
+11
source share

Since the OP has not been in the last 24 hours, I will post the solution found in the stream to the Android developers of the Google Group .

The problem was that the Show Notifications option for this application was not checked in the settings (this is possible in new versions of Android). This not only prevents notifications from appearing in the notification panel, but also prevents the display of toasts.

A bug for this was discovered here .

+5
source share

All Articles