Reprinted from: http://blog.csdn.net/iefreer/article/details/8812585
Sometimes you need to launch another app from one app, such as twitter/.
If you do not know the activity of the app, but know the package name, then you can use the following method:
[Java]View Plaincopy
- Intent launchintent = Getpackagemanager (). Getlaunchintentforpackage ("com.package.address");
- StartActivity (launchintent);
If there is a partnership between apps, you can get a manifest file for the Affiliate app (manifest), you can learn about package/activity from this file,
You can use the following method to launch the app-specific activity interface:
[Java]View Plaincopy < param name= "allowfullscreen" value= "false" >< param name= "wmode" value= "Transparent" >
- Intent Intent = new Intent (Intent.action_main);
- Intent.setcomponent (new ComponentName ("com.package.address","com.package.address.MainActivity"));
- StartActivity (Intent);
If you want to pass parameters when you start the app, you can set it in intent (Intent):
[PHP]View Plaincopy
- Intent.putextra ("Firstkeyname","Firstkeyvalue");
- Intent.putextra ("Secondkeyname","Secondkeyvalue");
Reference Links:
Http://developer.android.com/guide/components/intents-filters.html
Android: Launch additional apps and transfer parameters (GO)