-2

It always displays AndroidAdminApi Label above all the activities. I can change the App Name inside manifest code, But Is there any way to put the Label for individual Activity?

Android Manifest Code

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity android:name=".Activities.UserManagement.Auth.Login.LoginActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

enter image description here

Pankaj
  • 9,749
  • 32
  • 139
  • 283
  • 1
    [http://stackoverflow.com/questions/2198410/how-to-change-title-of-activity-in-android](http://stackoverflow.com/questions/2198410/how-to-change-title-of-activity-in-android) – M D May 12 '17 at 07:15
  • 1
    Possible duplicate of [How to change title of Activity in Android?](http://stackoverflow.com/questions/2198410/how-to-change-title-of-activity-in-android) – David Rawson May 12 '17 at 07:24

4 Answers4

2

You can change like this

getSupportActionBar().setTitle("Your custom title");

Or

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    setTitle("Your custom title");
}
John Joe
  • 12,412
  • 16
  • 70
  • 135
1

You can add like this in manifest.xml

    <activity
        android:name=".xyz"
        android:label="XYZ" />


    <activity
        android:name=".abc"
        android:label="ABC" />
Dharmbir Singh
  • 17,485
  • 5
  • 50
  • 66
0

Yes, you change the label for individual activity using actionBar.setTitle OR simply setTitle in your activity

1. Using action bar title

getActionBar().setTitle(title); 

OR

getSupportActionBar().setTitle(title); //if you are using appcompat library, also you can try setTitle in your activity directly

2. Directly specifying label for activity in manifest

<activity
    android:name="package.yourActivity"
    android:label="Label" />

3. Try using setTitle directly in your activity

PEHLAJ
  • 9,980
  • 9
  • 41
  • 53
0

you should add label option in activity level ( No Activity level )

android:label=“ACTIONBAR_TITLE_TEXT"

Good luck !

Park
  • 401
  • 4
  • 10