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() ?
Asked
Active
Viewed 66 times
2 Answers
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
-
Diws this also apply to activities who have the launcher.main set? – joz Apr 01 '14 at 05:09
-
Yes, I believe all activities. – Szymon Apr 01 '14 at 05:16
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