How to prevent Multiple Toast Overlaps

Instead of calling cancel(). Try resetting the text and call show(). This should cancel the last toast by itself

myToast.setText("wrong key")
myToast.show();

If you keep using the same myToast instead of creating one every time I guess they won’t stack up.

Leave a Comment