Java tutorial
//package com.java2s; //License from project: Artistic License import android.app.Activity; import android.content.Intent; public class Main { public static void startActivityAndDestroy(Activity activity, Class<? extends Activity> clazz) { Intent intent = new Intent(activity, clazz); activity.startActivity(intent); activity.finish(); } }