start Activity And Destroy - Android android.app

Android examples for android.app:Activity Start

Description

start Activity And Destroy

Demo Code

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);//from   ww  w . j av  a2s .c om
    activity.finish();
  }

}

Related Tutorials