I am developing an android app in eclipse. I thought I named it optimuse, that is also the title of the folder eclipse created.
But when I run the app, the name appears as "MainActivity". This is also displayed on the top of the window.
How can I change this. I checked my manifest and it said:
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
...
I guess I need to change #string/app_name. But where can I do that?
PS: I did try to fill in a string instead of #string/app_name, but that did not change anything.
Thanks!
EDIT:
For clarity, here is my Manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dh.optimuse"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="15" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
open the Strings.xml in values folder which is located in the res folder.
change the app_name to whatever you want
If you don't know the location.just hold ctrl and move the cursor to the #string/app_name and click. it will open strings.xml file
In addition to the previous answers:
What you are changing inside of <application> tag is the name of the app (that is shown below the app icon).
If you need to change a label for the Activity (shown at the title of the screen when the app runs), then you need to change the value of android:label inside of the <actiity> tag.
Related
this problem is confusing me and i can't see where the issue is. when i change my app name and icon my launch activity name and icon (the one that shows at the top left screen) changes to that name and icon. But when i check the xml file of the launch activity it shows me otherwise.
App name : online shop
Activity name : Anmeldung
here is the Graphical layout in eclipse of the activity and that's how it supose to be :
and here is the activity in the emulator :
Androidmanifest.xml :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.dbreader"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="19"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_login"
android:label="#string/activity_login"
android:theme="#style/AppTheme" >
<activity
android:name="com.hochschule.main.Login"
android:icon="#drawable/ic_launcher"
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.hochschule.main.Registrieren"
android:icon="#drawable/ic_registrieren"
android:label="#string/title_activity_registrieren" >
</activity>
<activity
android:name="com.hochschule.main.Shop"
android:icon="#drawable/ic_launcher"
android:label="#string/title_activity_shop" >
</activity>
<activity
android:name="com.hochschule.main.WarenKorb"
android:icon="#drawable/ic_warenkorb"
android:label="#string/title_activity_waren_korb" >
</activity>
</application>
</manifest>
Android label tag is used for both Default Title bar and App Name in Home Screen
android:label="#string/app_name"
It may conflict with activity's label name sometimes. You can apply the programmatic method as alternative which surely works.
If you want to set Activity to your desired name in onCreate() in your activity as below:
this.setTitle("Your Title");
To set Icon:
getActionBar().setIcon(R.drawable.Your_Icon);
If you are using the support library to add the actionbar (ex: ToolBar), use getSupportActionBar instead of getActionBar.
Hope this helps.
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.
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.
I implemented a android project named 'vignesh', in which i had source package as com.example.learn.android. In my tab while uninstalling the app, its showing com.example.learn instead of project name alone. Please advice..
You can specify your application label in the AndroidManifest.xml
<application
android:label="#string/app_name"
...>
</application>
In the above example you have to define app_name in res/strings.xml
<string name="app_name">My app name</string>
If this is not working in the AndroidManifest.xml file:
<application
android:label="#string/app_name"
...>
</application>
Look for the startup activity(the activity with the android.intent.action.MAIN & android.intent.category.LAUNCHER), example:
<activity
android:name=".SplashScreen"
android:label="com.example.learn"
android:noHistory="true"
android:screenOrientation="landscape"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
You probably have the android:label mentioned just like the example above. The strange thing is that Android takes your first activity's name (label) as app name (I don't know why).
If you just remove (or rename) the android:label="com.example.learn" line it should be ok. Removing the line ensures that the app will look for the android:label tag defined in the <application> part of the AndroidManifest.xml file.
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"