start Activity And Destroy - Android Activity

Android examples for Activity:Activity Start

Description

start Activity And Destroy

Demo Code


//package com.java2s;
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);//  ww w  .  jav  a  2  s. co  m
        activity.finish();
    }
}

Related Tutorials