0

I am trying to have a different app name for an Activity "My Profile Photo" but it does not seem to show up even when I have given android:label="My Profile Pic" to that particular activity The Manifest File:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.aditya.myprofile">

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"

    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity android:name=".MainActivity"
        android:label="My Profile">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

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

</manifest>

The XML Design:

The Android App name space is empty

image

Where am I going wrong?

Tegr4
  • 13
  • 6
  • Possible duplicate of [How to change the text on the action bar](https://stackoverflow.com/questions/3438276/how-to-change-the-text-on-the-action-bar) – guisantogui Nov 08 '17 at 11:31

2 Answers2

0

Try this add title through java code add this code in your activity like this

getSupportActionBar().setTitle("My Profile");
Ratilal Chopda
  • 4,162
  • 4
  • 18
  • 31
-1

I think you need to set a theme to your activity in your manifest.

<activity android:name=".ProfilePhoto"
   android:theme="@style/AppTheme"
   android:label="@string/profilePicture></activity>

Another solution : in your activity in onCreate you need to call :

    getSupportActionBar().setTitle("Your Activity Title");
havabon
  • 134
  • 7