Android examples for Activity:Activity Jump
jump To Activity For Result
//package com.java2s; import android.app.Activity; import android.content.Context; import android.content.Intent; public class Main { public static void jumpToActivityForResult(Context context, Class<? extends Activity> targetClass, int resultId, String... datas) {//from w ww.j a v a 2 s . c o m Intent datatIntent = new Intent(context, targetClass); if (datas != null) { for (int i = 0; i < datas.length; ++i) { datatIntent.putExtra("data" + i, datas[i]); } } ((Activity) context).startActivityForResult(datatIntent, resultId); } public static void jumpToActivityForResult(Context context, Class<? extends Activity> targetClass, int resultId) { Intent datatIntent = new Intent(context, targetClass); ((Activity) context).startActivityForResult(datatIntent, resultId); } }