Starts Activity by creating an intent - Android Intent

Android examples for Intent:Open App

Description

Starts Activity by creating an intent

Demo Code


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

public class Main {
    /**/*w w  w .java2s. c  o  m*/
     * Starts Activity by creating an intent
     * @param context
     * @param clazz
     */
    public static void startActivity(Context context, Class clazz) {
        Intent intent = new Intent(context, clazz);
        context.startActivity(intent);
    }
}

Related Tutorials