Java tutorial
//package com.java2s; import android.app.Activity; import android.content.Intent; public class Main { /** * Start new activity and finish previous one. * * @param activity is current activity to finish * @param intent of new activity to start */ public static void startActivityAndFinishPreviousOne(Activity activity, Intent intent) { activity.startActivity(intent); activity.finish(); } }