1. Start the main activity of another application.
This code is the main activity to start another application, and of course you can start any activity componentname componetname = new ComponentName ( // This is another application's package name "Com.poynt.weibo", //This parameter is to start the activity "com.poynt.weibo.ui.IndexActivity"); try { Intent Intent = new Intent (); Intent.setcomponent (componetname); StartActivity (intent); } catch (Exception e) { /// Toast.maketext (Getapplicationcontext), "You can be prompted here to not find the application, or to do other things!" ", 0). Show (); }
2. Start the activity of another program and pass the parameters over!
Call another Android program B in an Android application A and pass the data to B componentname componentname = new ComponentName ("Com.xiaohua.pla Yer.activity "," com.xiaohua.player.activity.PlayerActivity "); Intent Intent = new Intent (); Bundle bundle = new bundle (); Bundle.putstring ("Resurl", Resurl); Bundle.putserializable ("Picurllist", picurllist); Intent.putextras (bundle); Intent.setcomponent (componentname); StartActivity (Intent); Note: com.xiaohua.player.activity: Package Path playeractivity:activity class resurl:string type picurllist: Array, can also be an object application after installation, can be called as above . Accept activity:public void Getparameterbyintent () {Intent mintent = this.getintent (); String Resurl = Mintent.getstringextra ("Resurl"); String[] Picurllist = (string[]) Mintent.getserializableextra ("Picurllist"); if (null! = picurllist) {int count = Picurllist.length; for (int i = 0; i < count; i++) {log.e ("tag", "picurllist[" + i + "]" +Picurllist); }} from: Http://hi.baidu.com/huaxinchang/blog/item/5fa81903474097f409fa9305.html
3. call the activity in an apk with another apk
Intent Intent = new Intent (intent.action_web_search); Intent.putextra (Searchmanager.query, "SearchString") startactivity (intent);
Reference Link: http://www.apkbus.com/android-43480-1-1.html
Http://android.toolib.net/reference/android/content/ComponentName.html