0

I have two launcher in my app, one is a normal activity with the intent-filter for launcher/main and the other one is an activityAlias.

For both, I supply labels in the manifest via my strings.xml resources. The reason for this is, that I want to provide different labels in different locales.

Unfortunately only the label of my activity is changed accordingly to the language selected in the android settings.

Why is that?

<activity
    android:name=".MainActivity"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:screenOrientation="portrait"
    android:theme="@style/AppTheme.Transparent">

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

</activity>

and the alias

<activity-alias android:name=".MainAlias" 
    android:enabled="true" 
    android:exported="true" 
    android:icon="@drawable/alias_icon" 
    android:label="@string/alias_label" 
    android:targetActivity=".MainActivity">                                             
        <intent-filter> 
            <action android:name="android.intent.action.MAIN"/> 
            <category android:name="android.intent.category.LAUNCHER"/>   
        </intent-filter> 
</activity-alias>
JacksOnF1re
  • 3,336
  • 24
  • 55
  • How did you test this? If you tested it by installing your app and then changing the locale, the home screen launcher of your device or emulator may be improperly caching some information. In that case, reboot. Or, uninstall and reinstall the app and see if the proper translation shows up. – CommonsWare Mar 11 '16 at 17:55
  • I changed my locale in the android settings and reinstalled my application. I expected the labels to be different after the installation, but only the activity did. – JacksOnF1re Mar 11 '16 at 17:56
  • Do you have alias_label in both `strings.xml` files in their respectful `values` folders? – Vucko Mar 11 '16 at 18:45
  • Yep, the resource name is also equal in both xml files. – JacksOnF1re Mar 11 '16 at 19:03

0 Answers0