Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Toast is not shown on Samsung Galaxy S3 (latest update 4.1.2)

I have a toast that is displayed in the following way:

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

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

Has anyone else experienced this and has a solution?

like image 325
Tobias Lindberg Avatar asked Jan 14 '13 13:01

Tobias Lindberg


People also ask

Why is my toast not showing up?

If Toast is not showing that means either you have not called show () method or you are not on UI thread Show activity on this post. 1 - You have not append .show (); at the very end of Toast.makeText (getActivity (), "Hi", Toast.LENGTH_SHORT).

Can I update my Samsung Galaxy S3 to Android 4 4 4?

You can now update your Samsung Galaxy S3 to Android 4.4.2 KitKat based C-RoM custom firmware. This ROM is smooth, fast, and stable and is build on AOSP sources.

How to check for software update in Samsung Galaxy S3 (gt-i9300)?

How to check for Software Update in Samsung Galaxy S3(GT-I9300) JB OS 4.3? Last Update date : Oct 12. 2020 1 2 STEP 1. GETTING STARTED CLICK HEREto know about Mobile Firmware in Samsung Smartphones. a). Tap on Appsicon as shown below. b). Now, Tap and drag the Application screentowards right and then tap on Settingsicon. STEP 2.

How to fix toast not working on iPhone?

In the device list click on "drop-down icon" under "Action" column. Now reinstalling the app it will work. Show activity on this post. if this is not working, please put a log.i (); in your each condition may be its going to the last else and you are not getting the Toast. Show activity on this post.


1 Answers

In newer Android phones there is a "Show notifications" checkbox in App Settings and for some reason if notifications are disabled it also disables Toasts. The issue has been reported here:

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

But looking on the source code:

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

it seems like it might 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;
}
like image 112
Tobias Lindberg Avatar answered Sep 20 '22 17:09

Tobias Lindberg