In my application for Android the user has to tap a button and every time the button is tapped a toast appears saying "you have tapped n times", but if the user taps quickly several times the toasts are too slow and they appear one by one.
public void onClick(View v)
{
n++;
Toast.makeText(MainActivity.this, "You have tapped "+n+" times", Toast.LENGTH_SHORT).show();
}
Is there a way to "delete" all the old toasts in order to let appear only the last one?