How to change the name under the erase icon

I didn't find an exact answer to figure out how to change the name under the icon for the launcher and android app (with Eclipse).

I tried editing "@ string / app_name" in the app (manifest) but it doesn't work. And now in MainActivity.java it gives me the error "R cannot be resolved to variable" on this line:getMenuInflater().inflate(R.menu.activity_main, menu);

It returns this error to me also if you write "app_name" in @ string / inside. I'm going crazy.

+3


source to share


3 answers


Open up res/values/strings.xml

change this line,

<string name="app_name">default app name</string>

      



with your desired app name

<string name="app_name">your desired name</string>

      

Do not make changes to the file manifest

.

+4


source


Find the android:label

inside <Activity>

that has

<category android:name="android.intent.category.LAUNCHER" />

      

inside <intent-filter>

and change its value:



<activity
    android:name=".Activity_1_1_Splash"
    android:label="@string/app_name"
    android:screenOrientation="portrait" >
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />

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

      

And if you want to change the value of a resource, @pratik's answer will help you.

+5


source


if you want to change the name of the app under the launcher icon, change this value android:label="@string/app_name"

inside the activity tag of the main launcher

        <activity android:name="com.test.app"
                  android:label="@string/app_name" >
                  <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
                    <category android:name="android.intent.category.LAUNCHER" />
                  </intent-filter>
        </activity>

      

And if you want to change the app name inside

Settings -> Application Manager -> Loaded

where you have all installed apps, then change this one android:label="@string/app_name"

inside app tag

<application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >

            ........

        <activity android:name="com.test.app" >
        </activity>

             .......

 </application>

      

0


source







All Articles