My Android app is not displaying the application name "app_name", instead its displaying the activity name "title". This is from my manifest file;
<application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".Main" android:label="@string/title"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity>
Why is the application getting its name from the Main activity and ignoring the Application label?
This is the full manifest
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.extempor.cheetah" android:versionCode="1" android:versionName="1.0"> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".Main" android:label="@string/title"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".InfoHelp" android:label="@string/titleInfo"> <intent-filter> <action android:name="android.intent.action.HELPINFO" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> </application> <uses-sdk android:minSdkVersion="10" /> <uses-permission android:name="android.permission.INTERNET" /> </manifest>
Go to home screen settings or drawer settings(depending upon your need). Then change icon labels from hide to show.
Choose the Apps option for an app icon. Next, select the app icon you want to customize from the list of installed apps. Use the Tap to Edit Label button (it will also show the app name) to change the name. Then, enter the new custom name or label and select Done.
You can simply call the setTitle() function from within your Activity . It takes either an int (resource ID) or a CharSequence as a parameter. Show activity on this post. For changing Activity title you should use setTitle() of Activity class.
This question explained the reason for this to me:
Naming my application in android
The launcher actually shows android:label and android:icon for activity(ies) that declare:
<intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter>
so application label is of no use.
You can only display one label at a time. Application label or Activity label.
If you set a label and run an activity, you will see the Activity label.
To see Application label, doesn't set android:label="@string/title"
on Main activity.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With