Android应用启动还有一个应用

已知包名和应用入口Activity

包名:org.ww
应用入口:Activity:org.ww.TestActivity


Intent intent = new Intent();   
intent.setComponent(new ComponentName("org.ww","org.ww.TestActivity"));   
intent.setAction(Intent.ACTION_VIEW);   
startActivity(intent);


仅仅知包名
包名:org.ww


// 使用packageManager通过应用包名,得到intent
PackageManager packageManager = this.getPackageManager();
Intent intentPackage = packageManager.getLaunchIntentForPackage("org.ww");
startActivity(intentPackage);



posted @ 2015-03-27 12:30  zfyouxi  阅读(143)  评论(0编辑  收藏  举报