Java tutorial
//package com.java2s; import android.widget.Toast; public class Main { public static void waitForPreviousToastDismiss(int duration) throws InterruptedException { int durationInMillisecond; if (duration == Toast.LENGTH_SHORT) durationInMillisecond = 2000; else if (duration == Toast.LENGTH_LONG) durationInMillisecond = 3500; else durationInMillisecond = duration; Thread.sleep(durationInMillisecond); } }