0

In my Android app I'm setting the title for an Activity using android:label in the AndroidManifest.xml. But now I want to display different titles in the Menu Bar (when the app is opened) and for the caption under my icon on the Homescreen. Is there any way to achieve this using xml? Or do I have to set the title for the Startscreen icon in the xml and have to set the title displayed in the ActionBar using Activity.setTitle() ?

joz
  • 652
  • 2
  • 8
  • 19

2 Answers2

0

The text under the icon on home screen is defined by android:label in <application> element in your manifest xml.

The same android:label exists for each activity in <activity> element. This will set the text in the action bar/title bar for each activity separately.

<application 
    android:label="@string/home_screen_app_name"

    <activity 
        android:name=".main"
        android:label="@string/main_activity_title">
    </activity>

</application>
Szymon
  • 42,577
  • 16
  • 96
  • 114
0

I found a question that does answer mine: How to set different label for launcher rather than activity title? Short, the answer is to set the label attribute in the intent

Community
  • 1
  • 1
joz
  • 652
  • 2
  • 8
  • 19