Android developer page for <application> contains the flag hasCode. Its description says:
An application would not have any code of its own only if it's using
nothing but built-in component classes, such as an activity that uses
the AliasActivity class, a rare occurrence.
Can someone please give a code example of the AliasActivity use case (rare occurence) they talk about ?
An AliasActivity is - as the name suggests - just an alias to another activity.
You can create one just in XML. There is an example available in the Android git repository.
You manifest could look like this:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android.aliasactivity">
<application android:hasCode="false" android:label="@string/app_label">
<activity android:name="android.app.AliasActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<meta-data android:name="android.app.alias"
android:resource="@xml/alias" />
</activity>
</application>
</manifest>
In res/xml/alias.xml you define the intent:
<alias xmlns:android="http://schemas.android.com/apk/res/android">
<intent android:action="android.intent.action.VIEW"
android:data="http://www.google.com/">
</intent>
</alias>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With