Reputation: 185
How to change the name of the app which is to be displayed on home screen?
Whenever I try to change the android:label="title_name" inside activity of manifest file, title bar changes which is expected. But app name also changes in home screen to "title_name"
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:theme="@style/AppTheme.NoActionBar"
android:label="title_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Is there any other method to change app name only?
Upvotes: 2
Views: 2398
Reputation: 6405
Android label tag is used for both Default Title bar and App Name in Home Screen
android:label="@string/app_name"
If you want to change only App Name then change label and set Title Bar Text to your desire in onCreate() in your activity as below:
this.setTitle("Your Title");
Hope this helps.
Upvotes: 3
Reputation: 484
You are changing the android:label under the activity tag, which is causing this issue.
Your application name is android:label="@string/app_name" under application tag, Go to the folder res/values/strings.xml where u can find something like this
<resources>
<string name="app_name">APP NAME</string>
</resources>
mention your application name at "APP NAME". This will work
Upvotes: 2
Reputation: 53
android:name attribute is for subclassing Application.
android:label attribute is for Application label(which is displaced on homescreen.)
Upvotes: 0
Reputation: 23
You can change 'app name' in strings.xml
example)
<string name="app_name">any</string>
Upvotes: 0