Java tutorial
//package com.java2s; import java.util.Map; import android.content.Context; import android.content.Intent; import android.os.Bundle; public class Main { public static Intent makeIntent(Context context, Class<?> classInstance, Map<String, Object> param) { Intent intent = new Intent(context, classInstance); for (Object obj : param.keySet().toArray()) { String key = (String) obj; intent.putExtra(key, (String) param.get(key)); } return intent; } public static Intent makeIntent(Context context, Class<?> classInstance, Bundle param) { Intent intent = new Intent(context, classInstance); intent.putExtras(param); return intent; } }