Integration between Android Apps

Source: Internet
Author: User

The first time I installed WSM tools on my phone, I found that WSM was just a simple integration framework that required the tools to be installed separately, and the installation of a tool later found that the icon did not show, it feels amazing, the recent work needs, but also to do the integration between Android applications, it is actually very simple. Only need to provide the application package, activity name to be integrated

For example, to integrate another application in the current application, as in the same application by booting through intent:

1  Public classMainactivityextendsActivity {2 @Override3     protected voidonCreate (Bundle savedinstancestate) {4         Super. OnCreate (savedinstancestate);5 Setcontentview (r.layout.main);6             7Intent Intent =NewIntent ();8         //The package name of the app and the main activity to start9ComponentName componentname =NewComponentName ("Com.xxxx.xxxx", "com.xxxx.xxxx.App"); Ten intent.setcomponent (componentname); One intent.addflags (intent.flag_activity_new_task); AIntent.putextra ("ParamName", "Paramvalue"); - startactivity (intent); - the     }   -}

If you want the integrated app icon to be hidden, you need to set it in Androidmanifest.xml and modify the Android.intent.category.LAUNCHER to Android.intent.category.DEFAULT

To implement the hidden icons:

<ActivityAndroid:name=". Mainactivity "android:process= "Com.baixd.framework"Android:theme= "@android: Style/theme.notitlebar"Android:label= "@string/app_name">       <Intent-filter>          <ActionAndroid:name= "Android.intent.action.MAIN" />          <!--<category android:name= "Android.intent.category.LAUNCHER"/> -         <categoryAndroid:name= "Android.intent.category.DEFAULT" />       </Intent-filter></Activity>

Integration between Android Apps

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.