How to cancel Toast

DroidBot picture DroidBot · Dec 9, 2010 · Viewed 26.1k times · Source

I developed an android application and I am facing a problem with Toast. Suppose I am displaying a Toast, it is displayed on the application window. When a Dialog box is appears, the toast doesn't disappear instantly .

I want to know how I can cancel the toast.

Answer

EboMike picture EboMike · Dec 9, 2010

Toast.makeText returns a Toast object. Call cancel() on this object to cancel it.