打开另外一个App
/** * 打开一个app * * @param packageName * @param data * @return */ public static boolean lanuchApp(Context context,String packageName, Bundle data) { try { Intent resolveIntent = context.getPackageManager().getLaunchIntentForPackage(packageName); if (resolveIntent == null) { PackageInfo p = context.getPackageManager().getPackageInfo(packageName, PackageManager.GET_ACTIVITIES); if (p != null) { resolveIntent = new Intent(packageName); } } if (resolveIntent != null) { if (data == null){ data = new Bundle(); } data.putBoolean("a", true); resolveIntent.putExtras(data); resolveIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(resolveIntent); return true; } } catch (Exception e) { } return false; }