change Activity via Intent - Android Intent

Android examples for Intent:Open App

Description

change Activity via Intent

Demo Code


//package com.java2s;

import android.content.Context;

import android.content.Intent;

public class Main {

    public static <T> void changeActivity(Context context, Class<T> clazz) {
        Intent intent = new Intent(context, clazz);
        context.startActivity(intent);/*from  w  ww  .  j ava 2s .  co m*/
    }
}

Related Tutorials