start One Activity By Context - Android Activity

Android examples for Activity:Activity Start

Description

start One Activity By Context

Demo Code


//package com.java2s;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;

public class Main {

    @SuppressWarnings("rawtypes")
    public static void startOneActivityByContext(Context mActivity,
            Class cls) {//w w  w .  java2 s .c  o m
        Intent intent = new Intent(mActivity, cls);
        mActivity.startActivity(intent);
        ((Activity) mActivity).finish();
    }
}

Related Tutorials