In my app, I construct a calendar widget for my activity, when I scroll it to previous or next month, I let it make a toast and show it.
The question is, the toast n
Simple. Simply call the method .cancel() on the toast once you want to create another toast.
Start by defining a Toast variable at the top of your class like this
private Toast mToast;
Later, When you want to create a new Toast(and have the old one disappear), do this.
if(mToast != null) {
mToast.cancel(); //if a toast exists it deletes it, allowing you to create a new one
}
mToast = Toast.makeText(this, "This will show up now!", Toast.LENGTH_LONG);
mToast.show(); //creates the new toast.