Java tutorial
//package com.java2s; import android.content.Context; import android.content.Intent; public class Main { public static void takeMyselfToForeground(Context context, Class launcher) { Intent intent = new Intent(Intent.ACTION_MAIN); intent.setClass(context, launcher); intent.addCategory(Intent.CATEGORY_LAUNCHER); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); context.startActivity(intent); } }