android 从APP启动另一个APP

写下如下代码即可

import android.content.ComponentName; //引入

 

Intent mIntent = new Intent("android.intent.action.MAIN");
ComponentName comp = new ComponentName("你要启动app的包命,如:com.android.app", "你要启动app的首页,如:com.android.app.MainAcrivity");
mIntent.setComponent(comp);
mIntent.addCategory("android.intent.category.LAUNCHER"); 
startActivity(mIntent);//启动
finish();//关闭app

posted @ 2014-11-26 15:41  (龍)  阅读(2754)  评论(0)    收藏  举报