Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is my Android app name same as the launcher activity name?

I understand that android:label= decides the name of the app.

I have done it properly as follows:

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

    <uses-sdk
        android:minSdkVersion="11"
        android:targetSdkVersion="16" />

    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" >
    </uses-permission>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" >
    </uses-permission>

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.example.drsystem.LoginActivity"
            android:label="@string/title_activity_login" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.example.drsystem.CalibrationActivity"
            android:label="@string/title_activity_calibration" >
        </activity>
        <activity
            android:name="com.example.drsystem.DeadReckoningActivity"
            android:label="@string/title_activity_dead_reckoning" >
        </activity>
    </application>

</manifest>

But my app name appears beneath the icon on the screen is still "@string/title_activity_login"

I want it to be "@string/app_name"

Anyone can help?

Thanks in advance

like image 342
Sibbs Gambling Avatar asked Jun 20 '13 14:06

Sibbs Gambling


People also ask

What is Android Activity name?

An activity represents a single screen with a user interface just like window or frame of Java. Android activity is the subclass of ContextThemeWrapper class. The Activity class defines the following call backs i.e. events. You don't need to implement all the callbacks methods.

What is Android launcher activity?

Launcher Activities are the activities that can be launched for a given intent. For example, when you press an app icon on the home screen, the StartActivity intent starts the activity you have specified as the launcher activity.

How do I change the default app name in Android Studio?

Usually, when you change the project name, you wanna change the name of your app too. Go to the res folder > values > strings. xml and change the app_name to your new name. Done!

What do you mean by launcher activity?

Displays a list of all activities which can be performed for a given intent. Launches when clicked.


3 Answers

It's not really weird, but just good to know : the Android's launcher use the Intent Launcher Label or if not set, the activity's label and finally application's label

 <intent-filter android:label="@string/app_name">
     <action android:name="android.intent.action.MAIN" />
     <category android:name="android.intent.category.LAUNCHER" />
 </intent-filter>
like image 164
Patrice GILBERT Avatar answered Oct 21 '22 22:10

Patrice GILBERT


Naming my application in android

This is a bit weird in android... App name is pretty much determined by first activity label.. or application label if it isn't set.

like image 26
bryanph Avatar answered Oct 21 '22 23:10

bryanph


Just remove this line android:label="@string/title_activity_login" from the Manifest file

like image 29
petryk33 Avatar answered Oct 21 '22 23:10

petryk33