Android examples for Activity:Activity Start
start New Activity
//package com.java2s; 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//from ww w. j av a 2s .c om public void run() { Intent intent = new Intent(from, to); from.startActivity(intent); if (finishSelf == true) from.finish(); } }; handler.postDelayed(r, delayMillis); } }