Android App calls another app

Source: Internet
Author: User

Recent company projects add something, the caller is "mobile banking", the callee is "Bankeys", take a time to record, in fact, very simple

1. Caller:

This we can use the normal activity of the startup mode, the code is as follows:

New Intent (); Intent.setaction ("com.bankeys.mobile_sign"); Intent.putextra ("Data" ) 1);

2. Callee:

Add the following code to the manifest file of the activity that needs to be called by the caller app:

<activity            android:name= "Com.bankeys.shield.activity.BankBillingDetailsActivity"             Android:screenorientation= "Portrait" >            <intent-filter >                <action android:name= "  Com.bankeys.mobile_sign"/>                <category android:name=" Android.intent.category.DEFAULT "/>            </intent-filter> </activity>

There are two points to note:

①: The Scarlet Letter part of the code is guaranteed to be consistent

②: If the phone is not installed in the call app, when the call will be error, I resolved, through the following code to get all the information on the phone application (filter out the system application):

    /*** Non-system application in mobile phone *@paramContext *@return     */         Public StaticList<packageinfo>Getnosystemapp (Context context) {List<PackageInfo> list =NewArraylist<packageinfo>(); Packagemanager Pmanager=Context.getpackagemanager (); List<PackageInfo> L = pmanager.getinstalledpackages (0); if(List! =NULL&& l.size ()! = 0){             for(PackageInfo p:l) {if((p.applicationinfo.flags &p.applicationinfo.flag_system) <= 0) {List.add (P); }            }        }        returnlist; }

Android App calls 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.