Home » Android » Android: change app name in home screen

Android: change app name in home screen

Posted by: admin June 15, 2020 Leave a comment

Questions:

My app displays the name of its starting activity on the Home screen. I’ve tried to change the name by setting the android:label attribute in the manifest, under <application> to no avail. What is the correct way to accomplish this?

How to&Answers:

Change the name of the launcher activity using android:label. Seems to do the trick for me.

Answer:

Any activity with an intent filter for android.intent.category.Launcher will show up in the app drawer. You have to set a label for the activity as well as the application, the label for the activity (android:label=”@string/title_activity_main”) is what will show up in the app drawer.

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MainActivity"
        android:configChanges="orientation|keyboardHidden"
        android:label="@string/title_activity_main"
        android:screenOrientation="portrait" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

Answer:

Why don’t you change the name in your manifest, so it represents what you would like it to read.

In your manifest, use the element where you define your Activity, to have the following:

<activity android:name=".YourActivity" android:label="whatever you want"/>

Answer:

FYI, The above works for fresh copies being installed on your phone. If the old copy is copied over sometimes the change in name doesn’t work. Uninstall previous version, with previous name if the name isn’t updated.