Android examples for android.app:Activity Start
start Activity By Class and Bundle
import android.content.Context; import android.content.Intent; import android.os.Bundle; public class Main { public static Boolean startActivityByClass(Context context, String packName, String className, Bundle bundle) { Intent mIntent = new Intent(); mIntent.setClassName(packName, className); if (bundle != null) { mIntent.putExtras(bundle);//from w w w.j a va 2 s . c om } try { context.startActivity(mIntent); return true; } catch (Exception wException) { return false; } } public static Boolean startActivityByClass(Context context, String className) { return startActivityByClass(context, context.getPackageName(), className, null); } }