Pankaj Pankaj - 6 months ago 26
Android Question

Trying to set label for Individual Activity

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

Answer Source

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");
}