Android examples for android.app:Activity Start
start New Activity via android.os.Handler
import android.app.Activity; import android.content.Intent; import android.os.Handler; public class Main { public static void startNewActivity(final Activity from, final Class<?> to, long delayMillis, final boolean finishSelf) { Handler handler = new Handler(); Runnable r = new Runnable() { @Override//w ww .j a va2 s.c o m public void run() { Intent intent = new Intent(from, to); from.startActivity(intent); if (finishSelf == true) from.finish(); } }; handler.postDelayed(r, delayMillis); } }