Java tutorial
//package com.java2s; //License from project: Open Source License import android.content.ActivityNotFoundException; import android.content.Context; import android.content.Intent; public class Main { public static boolean launchActivity(Context from, Intent intent) { if (from == null) throw new NullPointerException("from == null"); try { from.startActivity(intent); return true; } catch (ActivityNotFoundException e) { e.printStackTrace(); return false; } } }