Java tutorial
//package com.java2s; import android.content.Context; import android.content.Intent; import android.os.Bundle; public class Main { public static void launchActivity(Context context, Class<?> activity) { Intent intent = new Intent(context, activity); intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); context.startActivity(intent); } public static void launchActivity(Context context, Class<?> activity, Bundle bundle) { Intent intent = new Intent(context, activity); intent.putExtras(bundle); intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); context.startActivity(intent); } public static void launchActivity(Context context, Class<?> activity, String key, int value) { Bundle bundle = new Bundle(); bundle.putInt(key, value); launchActivity(context, activity, bundle); } public static void launchActivity(Context context, Class<?> activity, String key, String value) { Bundle bundle = new Bundle(); bundle.putString(key, value); launchActivity(context, activity, bundle); } }