Activity-alias is designed for re-use of activity in Android.
When in the OnCreate () method of the activity, execute getintent (). Getcomponent (). GetClassName (); It may not be the name of the activity, it may be the name of the alias, for example: The Androidmenifest.xml has the following configuration:
<ActivityAndroid:name=". Testandroid "Android:icon= "@drawable/ic_menu_mark"> <Intent-filter> <ActionAndroid:name= "Android.intent.action.MAIN" /> <categoryAndroid:name= "Android.intent.category.LAUNCHER" /> </Intent-filter></Activity>
<Activity-aliasAndroid:name= "Testandroidalias"android:targetactivity= "Testandroid"Android:label= "Testandroidlias"Android:icon= "@drawable/ic_launcher_phone"> <Intent-filter> <ActionAndroid:name= "Android.intent.action.MAIN" /> <categoryAndroid:name= "Android.intent.category.DEFAULT" /> <categoryAndroid:name= "Android.intent.category.LAUNCHER" /> </Intent-filter></Activity-alias>
This app will build two entry points on the desktop, i.e. two quick icons to enter the testandroid activity. At this time getintent (). Getcomponent (). GetClassName () The name is not the same, one is com.test.TestAndroid, the other is Com.test.TestAndroidAlias.