1. 当知道包名,activityName名时
ComponentName componentName = new ComponentName("packageName",”ActivityName”);
Intent intent=new Intent();
intent.setComponent(componentName);
intent.setAction(Intent.ACTION_VIEW);
startActivity(intent);
2. 当知道包名。不知道activityName时;
PackageManager packageManager = context.getPackageManager();
Intent intent=new Intent();
intent =packageManager.getLaunchIntentForPackage("要调用应用的包名”);
startActivity(intent);
|