1

The name of my app is "[T]ime [T]racking [M]anager". Since that's too long at the homescreen (only "[T]ime [T]r..." is shown) I want my apps name to be "TTM" on the homescreen and app selection but I want the title of the app to be the full name. Like this: enter image description here

I tried to change my AndroidManifest like this:

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="TTM"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity" android:label="[T]ime [T]racking [M]anager">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

But now the name is everywhere (on homescreen AND title of the app) "[T]ime [T]racking [M]anager". How can I name them differently?

Cik
  • 17
  • 5
Zuyas
  • 182
  • 1
  • 1
  • 17

1 Answers1

1

You have to set the Activity title programmatically like below:

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        getSupportActionBar().setTitle("[T]ime [T]racking [M]anager");
    }
}

And remove android:label from activity tag

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="TTM"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity android:name=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>
Md. Asaduzzaman
  • 14,963
  • 2
  • 34
  • 46