Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: change app name in home screen

Tags:

android

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?

like image 761
1'' Avatar asked Dec 27 '12 23:12

1''


4 Answers

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

like image 112
AndroidPenguin Avatar answered Oct 15 '22 10:10

AndroidPenguin


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"/>
like image 20
Booger Avatar answered Oct 15 '22 10:10

Booger


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>
like image 25
Tonithy Avatar answered Oct 15 '22 10:10

Tonithy


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.

like image 41
user2664280 Avatar answered Oct 15 '22 09:10

user2664280