简体   繁体   中英

How to launch main activity of one application from another application on Android

I have 2 applications A & B. A has one activity. B has two activities. In B, one is the main (launcher) activity and the other is the default activity. All this is defined in the manifest file. But how do I launch the main activity of B from A ?

Do this

     Intent launchIntent = getPackageManager().getLaunchIntentForPackage("com.package.address");
     startActivity(launchIntent);`

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM