Change text displayed below app icon on android/eclipse - android

I would like to change the text that is displayed below the icon when you can look at all the apps on your phone, i.e. the "Facebook" below the facebook logo icon. How would I go about doing this? I have tried strings.xml but that did not have what I was looking for. Any help would be greatly appreciated.

You can do it programmatically in your activity:
setTitle("Activity title");
or
getActionBar().setTitle("Activity title");
Or in your AndroidManifest file, there is android:label tag:
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:theme="#style/AppTheme">
<activity
android:name="com.example.so1.MainActivity"
android:label="ACTIVITY NAME"
>
</activity>
</application>
Also if you want to change Launcher activity's title to something different than your app name then you could do it like this:
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:theme="#style/AppTheme">
<activity
android:name="com.example.so1.MainActivity"
android:label="ACTIVITY NAME"
>
<intent-filter android:label="APP NAME">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

How would I go about doing this?
This is controlled by the android:label attribute on the <activity> element in the manifest for your LAUNCHER activity. If your <activity> does not have an android:label attribute, it will inherit the value from the <application> element.

If you want to do it for your app that you are building,, then you need to change it inAndroidManifest.xml under android:label
<application
android:label="#string/app_name"
In your string.xml you can have an entry with app_name.
<string name="app_name">The Name</string>
Hope it helps.

Related

How to insert an android activity into the manifest given in a tutorial?

I am very new to android development with eclipse, and I encounter dozen of errors and problems. Here is the next one:
I am following an android tutorial given here in order to set up the action bar. In this tutorial is says to insert an activity as follows:
<activity android:theme="#style/Theme.AppCompat.Light" ... >
Can I just put this line into the xml manifest file?
<activity android:theme="#style/Theme.AppCompat.Light">
Or do I need to replace the '...' by something more useful?
Please read the docs: activity-element
The activity's name is required, so you would need to have:
<activity android:theme="#style/Theme.AppCompat.Light" android:name="MyActivity">
Other than that, you are not required to add any other attributes.
Although be sure to place the activity element within the proper place in your xml. It should be contained in your application block:
<application android:label="#string/app_name"
android:icon="#drawable/ic_launcher"
android:theme="#android:style/Theme.Holo.Light">
<activity android:name="MyActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
Unless you really want your app to work under API levels under 3.0 then you have to add it like this.
android:theme="#style/Theme.AppCompat.Light"
Inside your already defined activity in your manifest (the one that has the intent filter and other declarations).
otherwise you dont have to add that at all.
This is one example.
<activity
android:name=".MainActivity"
android:theme="#style/Theme.AppCompat.Light"
android:screenOrientation="portrait"
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 this is another
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme=#style/Theme.AppCompat.Light"" >
<activity android:name=".DetailActivity"
android:label="#string/app_name" >
</activity>
The second way you posted is just fine, be sure to close the activity tag so it looks like <activity android:theme="#style/Theme.AppCompat.Light"></activity>
Also, if you're using eclipse, it is easier to go into the AndroidManifest and under the Application tab scroll to the bottom where there's Application Nodes and then add your view from there. Eclipse will auto generate the correct code in the xml file.

App taking splash as the app name

Can anyone tell me how to change the app name? My app is taking splash as the app name on the Emulator since my first activity is splash.
EDIT:
It takes "splash" as the app name before the app is launched. Once it is launched the right name is displayed.
Manifest:
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.sanginfo.temperatureconvertor.SplashActivity"
android:label="#string/title_activity_splash" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.sanginfo.temperatureconvertor.LoginActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.LoginActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
In your manifest file under application tag change this tag with whatever you want as a app name..android:label="#string/app_name"
use the name attribute on application node as describe in :
http://developer.android.com/guide/topics/manifest/application-element.html
#stylojack_10
Go to the File name String.xml (Project->res->values->string.xml)
change the value of the tag name app_name.
you can even make your own tag there and make change in Android Manifest file under tag find android:label="#string/"your custom app name""
Hope this will resolve your problem
Solution 1: (this solution works most of the time)
Go to res -> values -> strings.xml -> appname, change name of the app there.
No go to Android Manifest and check if it looks like this:
<application
android:label="#string/app_name"
.......................
>
If android:label="#string/app_name" is changed to android:label="MyApp", than change it to one shown above. Your problem should be solved.
Solution 2:
there was a file called OldAppName.launch
it is located in workspace/.metadata/.plugins/org.eclipse.debug.core/.launches
also stuff on:
/User/workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings
also a glitch in Eclipse to show old app name instead of changing the name.

Cannot change name to the App

I've made an application and the AndroidManifest.xml has these attributes:
<application
android:allowBackup="true"
android:icon="#drawable/flower"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.manish.tabdemo.TabHostActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.manish.tabdemo.HomeActivity"/>
<activity android:name="com.manish.tabdemo.AboutActivity"/>
<activity android:name="com.manish.tabdemo.ContactActivity"/>
</application>
If you look at this picture you see the main page of my app. I want to change that TabHostDemo you see next to the fire flower with MK7 VRs List.
I googled and I found that if I want to change the title I have to edit some stuff in this way:
android:label="#string/app_name"
android:label="#string/app_name"
becomes...
android:label="#string/MK7 VRs List"
android:label="#string/MK7 VRs List"
If I do this I have an error that tells me "No resources found that matches the given name". Can you help me?
go to string/app_name and change it to what ever you want
<activity
android:name="com.manish.tabdemo.TabHostActivity"
android:label="#string/app_name" >
Open res/values/strings.xml and change the value of app_name in it. Then do a clean build.
OR
or directly use android:label="MK7 VRs List"

Missing App Title under App Icon on Device

I have installed the Android App on which I am currently working on my ASUS tablet, running 4.0.3
However, I must have accidentally deleted something in the Manifest.xml, because there is no words below the app icon. In other words, the app name is not appearing below the app icon on my device, and, as such, it is sorted in the All Apps screen in the wrong place.
Here is the relevant section of my manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="tra.games.mytaboo"
android:versionCode="1"
android:versionName="1.2.1" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="Taboo"
android:theme="#style/AppTheme" >
.....
What am I missing?
Tim, Label of your launcher activity will be displayed.
<activity
android:label="Taboo"
android:icon="#drawable/icon"
android:name=".activity.LaunchrActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"></action>
<category android:name="android.intent.category.LAUNCHER"></category>
</intent-filter>
</activity>
http://developer.android.com/guide/topics/manifest/activity-element.html#label
<activity
android:label="Your Name" <---- here name!
android:icon="#drawable/icon"
android:name=".activity.LoginActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"></action>
<category android:name="android.intent.category.LAUNCHER"></category>
</intent-filter>
</activity>
You could call the setTitle() function from within your Activity. It takes either an int (resource ID) or a CharSequence as a parameter.
You have missed android:label property. which is set your application name under the icon
android:label="#string/app_name"
Here I have set to load app name from string.xml file.
You can set it directly like this too
android:label="app name"

Activity label appears on home screen instead of app name

In AndroidManifest.xml, the application tag has:
android:label="#string/app_name"
and app_name in res/values/strings.xml reads "My App".
But after running or debugging on both the emulator and an attached device, the app icon on the home screen displays the main activity's label instead of the app label. Is this expected behavior, and if not why might it be happening?
Yes it is Expected behavior. The app name will be seen in the applications tab in settings. The main screen displays the launcher activity's label.
If you want to display the app_name property as the label of your application below the launcher icon you can specify the android:label property in the application tag of your android manifest file.
For example:
<application
android:name=".MyApp"
android:icon="#drawable/myIcon"
android:label="#string/app_name">
A workaround for this behaviour:
In manifest:
<application
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
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>
In MainActivity's onCreate:
getSupportActionBar().setTitle(R.string.activity_name);
By doing this, the app name will appear on home screen, and you can still have a different title for your launcher activity.
People see here, I got the same issue and finally resolve it.
Launcher show only the mainActivity because activity label is preferred for Phone Launcher.
So one want show Application labe rather than MainActivity's, he should delete the line:
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter android:label="#string/app_name" >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
delete this:
android:label="#string/title_activity_main"

Categories

Resources