android中使用代码启动其他程序
你要其他的程序,那程序要先到模器或真上面,因我要使用要其他程序的包。
的有以下方式(目前只知道):
一、使用Intent的setComponent方法
二、使用包管理器
一、使用Intent的setComponent方法
Intent intent = new Intent();
intent.setComponent(new ComponentName("包名", "包名.主名"));
intent.setAction(Intent.ACTION_VIEW);
startActivity(intent);
二、使用包管理器
Intent intent = new Intent();
intent = getPackageManager().getLaunchIntentForPackage("包名");
startActivity(intent);