2

I am simply making an demo application where I require to set different text for the label of launcher activity & application name.

When I set the launcher activity lable name to Login then it shows same application name. Is it possible to manually specify in the manifest application name.

This is how androidmanifest.xml looks but currently it is showing Login as application name also.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example" >

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".LoginActivity"
            android:label="@string/login_screen_title" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

</manifest>

strings.xml

<string name="app_name">Demo</string>

<!-- login screens strings -->
<string name="login_screen_title">LOGIN</string>

Thanks in advance.

N Sharma
  • 33,489
  • 95
  • 256
  • 444
  • possible duplicate of [Android Launcher label vs. activity title](http://stackoverflow.com/questions/3488664/android-launcher-label-vs-activity-title) –  Sep 16 '14 at 15:38

2 Answers2

2

Ah I saw accepted answer which @Mighter shared & it is working for me.

<activity
    android:name=".LoginActivity"
    android:label="@string/login_screen_title" >
    <intent-filter android:label="@string/app_name">
        <action android:name="android.intent.action.MAIN" />

        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>
N Sharma
  • 33,489
  • 95
  • 256
  • 444
2

it's totaly possible to have the launcher activity label different from the application name, your code seem to be correct its weird that it doesn't work for you, try setting a label for the intent-filter

 <intent-filter android:label="koko">

i quote below a paragraph from the android documentation which explain how labels are treated

In every case, the icon and label set in a containing element become the default icon and label settings for all of the container's subelements. Thus, the icon and label set in the element are the default icon and label for each of the application's components. Similarly, the icon and label set for a component — for example, an element — are the default settings for each of the component's elements. If an element sets a label, but an activity and its intent filter do not, the application label is treated as the label for both the activity and the intent filter.

source http://developer.android.com/guide/topics/manifest/manifest-intro.html#iconlabel

medhdj
  • 1,168
  • 10
  • 17