I have an app with four activities. I have set the intent-filter on one of them so it will be displayed first to the user when he starts the app. It has a label that says "Add expense".
Now the name under the icon for the app in the phone says "Add expense".
I would like the activities to have their different labels because they are displayed in the menu at the top of each activity and help the user understand what the activity is about. But I want the app name to be something other than the label of the activity with the intent-filter.
Is that possible?
Part of my manifest:
As you can see I've tried to set android:label="@string/app_name" on the application level but that doesn't work. The label on the activity is displayed under the icon anyway.
<application
android:icon="@drawable/ic_money_bag"
android:label="@string/app_name"
android:theme="@android:style/Theme.Holo.Light" >
<activity
android:name=".AddExpenseActivity"
android:label="@string/add_expense_header" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ListExpensesActivity"
android:label="@string/list_expenses_header" >
</activity>
<activity
android:name=".AddExpenseAccountActivity"
android:label="@string/add_expense_account_header" />
<activity
android:name=".ListExpenseAccountsActivity"
android:label="@string/list_expense_accounts_header" />
</application>
Regards, Mattias
You can use setTitle(String s) in each activity to change the name that appears in the title bar dynamically. So for you setting it in onCreate to whatever you want might suffice.
setTitle("Hello StackOverflow");