Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android app name not being displayed

Tags:

android

My Android app is not displaying the application name "app_name", instead its displaying the activity name "title". This is from my manifest file;

   <application android:icon="@drawable/icon" android:label="@string/app_name">    <activity android:name=".Main"               android:label="@string/title">         <intent-filter>             <action android:name="android.intent.action.MAIN" />             <category android:name="android.intent.category.LAUNCHER" />         </intent-filter>     </activity> 

Why is the application getting its name from the Main activity and ignoring the Application label?

This is the full manifest

    <?xml version="1.0" encoding="utf-8"?>     <manifest xmlns:android="http://schemas.android.com/apk/res/android"      package="com.extempor.cheetah"      android:versionCode="1"      android:versionName="1.0">     <application android:icon="@drawable/icon" android:label="@string/app_name">     <activity android:name=".Main"               android:label="@string/title">         <intent-filter>             <action android:name="android.intent.action.MAIN" />             <category android:name="android.intent.category.LAUNCHER" />         </intent-filter>     </activity>      <activity android:name=".InfoHelp"               android:label="@string/titleInfo">         <intent-filter>             <action android:name="android.intent.action.HELPINFO" />             <category android:name="android.intent.category.DEFAULT" />          </intent-filter>     </activity>     </application>     <uses-sdk android:minSdkVersion="10" />  <uses-permission android:name="android.permission.INTERNET" />      </manifest>  
like image 399
user913240 Avatar asked Aug 26 '11 04:08

user913240


People also ask

Why is my app name not showing?

Go to home screen settings or drawer settings(depending upon your need). Then change icon labels from hide to show.

How do you permanently rename an app on Android?

Choose the Apps option for an app icon. Next, select the app icon you want to customize from the list of installed apps. Use the Tap to Edit Label button (it will also show the app name) to change the name. Then, enter the new custom name or label and select Done.

How do I put a title on my app?

You can simply call the setTitle() function from within your Activity . It takes either an int (resource ID) or a CharSequence as a parameter. Show activity on this post. For changing Activity title you should use setTitle() of Activity class.


2 Answers

This question explained the reason for this to me:

Naming my application in android

The launcher actually shows android:label and android:icon for activity(ies) that declare:

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

so application label is of no use.

like image 88
diadyne Avatar answered Sep 29 '22 14:09

diadyne


You can only display one label at a time. Application label or Activity label.

If you set a label and run an activity, you will see the Activity label.

To see Application label, doesn't set android:label="@string/title" on Main activity.

like image 33
Ryan Amaral Avatar answered Sep 29 '22 14:09

Ryan Amaral