Android examples for Activity:Activity Jump
jump to Activity by Class
//package com.java2s; import android.content.Context; import android.content.Intent; public class Main { public static void jump1(Context context, Class clazz, String key, String value) {// w w w . j a va2 s. c o m Intent intent = new Intent(); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setClass(context, clazz); intent.putExtra(key, value); context.startActivity(intent); } public static void jump1(Context context, Class clazz, String key, String value, String key2, String value2) { Intent intent = new Intent(); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setClass(context, clazz); intent.putExtra(key, value); intent.putExtra(key2, value2); context.startActivity(intent); } }