Toast.show() not showing anything!

I recently came across this fact:

Inside a button On Click, I am trying to show a toast like below

Toast.makeText(getBaseContext(), "My message to show!", Toast.LENGTH_LONG).show();

Clicking on the button, did not show any toast. This is what I learnt as things to remember when showing a toast while debugging this issue :

  1. Make sure not to forget to call show() after the makeText.
  2. Check for the Context , if its the right one.
  3. The most important one , make sure your Android Notifications are on for your app, else the Toast will not be shown.

One thought on “Toast.show() not showing anything!

Leave a comment