Android-launch another app

Source: Internet
Author: User

Directly on the code:

                //get the app to jump through the package name, create the intent objectIntent Intent = Getpackagemanager (). Getlaunchintentforpackage ("Cn.easier.intelligencesystem"); //If intent is empty here, say the name does not install the application to jump                if(Intent! =NULL) {                    //Here's the same thing as the activity pass parameter, don't worry about how to pass the parameters, and the receiving parameters are the same as the activity and activity parameters.startactivity (Intent); } Else {                    //do not install app to jump, remindToast.maketext (Getapplicationcontext (), "Yo, download and install the app now!", Toast.length_long). Show (); }

If you are going to pass a parameter, you can pass it as normal intent, and the activity of the target receives the parameter as well.

In front of this is the activity that jumps directly to the other app's main.

Other than that. You can do this if you want to jump to the specified activity.

                New ComponentName ("PackageName", "ClassName");                Intent.setcomponent (CN);

Yes, so you can jump directly to the specified activity.

Android-launch another app

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.