Articles → ANDROID → activity-alias tag in manifest file in android

activity-alias tag in manifest file in android






Purpose





Syntax


<activity-alias android:name="alias_activity_name" android:targetActivity="activity_name"></activity-alias>



Scenario of using activity-alias




<activity android:name=".MainActivity">
	<action android:name="android.intent.action.MAIN" />
	<category android:name="android.intent.category.LAUNCHER" />
	</intent-filter>
</activity>








<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme">
	<activity android:name=".SecondActivity"></activity>
	<activity-alias android:name=".MainAliasActivity" android:targetActivity=".SecondActivity">
		<intent-filter>
			<action android:name="android.intent.action.MAIN" />
			<category android:name="android.intent.category.LAUNCHER" />
		</intent-filter>
	</activity-alias>
	<activity android:name=".MainActivity"></activity>
</application>





Posted By  -  Karan Gupta
 
Posted On  -  Tuesday, October 01, 2019
 
Updated On  -  Tuesday, March 31, 2020

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250