Java tutorial
//package com.java2s; import android.content.Context; import android.content.Intent; public class Main { public static Intent buildIntent(final Context context, String action, String data) { Intent intent = new Intent(action); intent.putExtra("what", data); intent.setPackage(context.getPackageName()); return intent; } }