How to cancel Toast

android, toast

Solution

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

Problem

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.

Original source