android 在一个应用中启动另一个应用?

来源:互联网 发布:网络英语流行词balll 编辑:程序博客网 时间:2024/05/22 00:50

需要:目标程序的包名、主类名。
代码:

Intent intent = new Intent(Intent.ACTION_MAIN);intent.addCategory(Intent.CATEGORY_LAUNCHER);ComponentName cn = new ComponentName("com.negier.bitmap", "com.negier.bitmap.MainActivity");        intent.setComponent(cn);        startActivity(intent);

com.negier.bitmap:目标程序包名
com.negier.bitmap.MainActivity:跳转到目标程序的类

0 0
原创粉丝点击