Xamarin,mono for Android launches other hidden apps with one app

Source: Internet
Author: User

It took hours to finish the test, and Mono for Android launches other hidden apps with one app.

Look directly at the code:

Hide App (launched) to configure the manifest file as follows, remove the original two tags and modify it to only one data

<Activity>

<activity android:icon= "@drawable/icon" android:label= "iocpdroid" Android:name= "iocpdroid". Iocpactivity " android:exported=" true ">

<intent-filter>

<data android:host= "iocpdroid. Iocpactivity"android:scheme="com.iocp"/>

</intent-filter>

</activity>

<Activity/>

It is normal for the app to be launched without launch, because you are not adding it in the manifest file.

Launch app

Intent Intent = new Intent ();

ComponentName cn = New ComponentName ("COM.IOCP", "iocpdroid". Iocpactivity");

Intent. SetComponent (CN);

Uri data = Uri.parse ("com.iocp.iocpdroid.IOCPActivity");//This should be consistent with the label in data in the B program

Intent. SetData (data);

StartActivity (Intent);

The green part of the two app must be the same, otherwise it won't start.

Finally, you must add permission.

<uses-permission android:name= "Android.permission.CHANGE_COMPONENT_ENABLED_STATE"/>

Xamarin,mono for Android launches other hidden apps with one app

Related Article

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.