Damaro
Damaro

Reputation: 55

Android Toast doesn't show up

I am using a Samsung Galaxy Note 8 with Android 8.0.

My Toast message (which was working) does not show up

Toast.makeText(this, "ABC", Toast.LENGTH_SHORT).show();

getApplicationContext(), getBaseContext() are not helping instead of this. Using this in an activity.

Upvotes: 3

Views: 5541

Answers (3)

Mohamed Sabirulla
Mohamed Sabirulla

Reputation: 29

wipe the data of emulator from AVD manager

Upvotes: -1

Tudor Cabau
Tudor Cabau

Reputation: 128

Go to your app settings -> Notifications and check if notifications are turned on. This action is possible in newer android versions

Even though a Toast is not a notification, it seems that NotificationManagerService.java will not show Toast if Notifications are disabled.

I'm posting a link with the issue: https://issuetracker.google.com/issues/36951147

Upvotes: 7

Uma Achanta
Uma Achanta

Reputation: 3729

try with class name

Toast.makeText(ActivityName.this, "ABC", Toast.LENGTH_SHORT).show();

here ActivityName is your activity name

Upvotes: 1

Related Questions