When i use the Label attribute in the manifest for an activity, it does not show in the recent application list. Code for activity in manifest file is:
<activity
android:name=".MainActivity"
android:screenOrientation="portrait"
android:theme="#style/MyTheme"
android:icon="#drawable/ic_launcher"
android:label=""
>
<intent-filter android:label="#string/app_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
when i use android:label="#string/app_name" , then it start showing in the recent tab, but i dont want activity label.
Your application is not visible in recent apps list because label of your main activity is empty.
Change
<activity... android:label="">
To
<activity... android:label="#string/some_name">
Edit:
If you don't want to show label for your activity then do the following.
You must set android:label="#string/some_name" in <activity> tag
And then write getActionBar().setDisplayShowTitleEnabled(false); in onCreate() method of your activity you want to hide label of.
This will let you hide the activity label and will show your app in recent apps list as well.
I have an Android application with a default activity which is defined in the AndroidManifest.xml:
<application
android:label="NameOfMyApp"
...
<activity
android:name=".LoginActivity"
android:label="Login">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.rei0d.wop.MainActivity" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
It seems that android:label="NameOfMyApp" will be overwritten if there is an attribut android:label for the default activity.
So I want to change the application's name to something else than Login, NameOfMyApp for example, without changing the android:label of the Login activity. Is this possible? Or do I have to create a blanc activity as default activity which starts the Login activity?
Well, there are multiple possibilities to fix this issue, unfortunately some of them don’t work on all devices.
It seems like that the Launcher takes the application-name from the label of the "Entry Activity". You can prevent his by adding the following attribute to your intent-filer:
<intent-filter android:label="NameOfMyApp">
Unfortunately some Launchers may ignore this, so I wouldn’t go for this solution.
I would recommend you to change the title of your Login-Activity programatically. So first of all change the android:label value of your .LoginActivity to the name of your app.
In onCreate or somewhere else set the title (assuming that you’re using the ActionBar).
getActionBar().setTitle("Login");
Note: You should get the title from a strings-xml file of course
I implement an app in which is one Activity designed for sharing text. Everything works fine, text is sharing etc. But if I would like to share some text, executing share action offered some applications which can handle sharing text. There is my application but shown icon is not equal of default ic_launcher. How can I change icon of my app when system offers me apps which can handle sharing text?
thanks.
you can change your app in manifest file..
<application
android:icon="#drawable/ic_launcher" //---- here--put your new icon in drawable folders and change it here
android:label="#string/app_name" // same thing.. change your app name in string.xml file.. then, here app name will change automatically....
android:theme="#style/AppTheme" >
<activity
android:name=".ui.MainActivity"
android:label="#string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
try this..
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
This should be a simple fix. My problem is that my launcher name is the same as my first activity. #string/app_name is my actual application name that I want it to show, but it is showing my first activity "Drafts" for the launcher. If I take out the #string/activity_drafts then the Launcher is correct, but then the first activity is my app_name which is not the behaviour I am looking for. I just want two seperate names for the launcher and the first activity's title and I'm not really sure what is going on here.
Manifest.xml
<application android:name="com.jordan.dictation.Dictation2Go"
android:allowBackup="true"
android:hardwareAccelerated="true"
android:icon="#drawable/dp_launcher2"
android:logo="#drawable/dp_white_logo"
android:label="#string/app_name"
android:theme="#style/MyTheme">
<activity
android:name="com.jordan.dictation.Draft_Activity"
android:screenOrientation="portrait"
android:label="#string/activity_drafts"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
I am not sure how to do it in manifest file, however you can do it programmatically in your activity:
setTitle("Activity title");
or
getActionBar().setTitle("Activity title");
EDIT: GOT IT!
<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>
Note: Doing this might result in unexpected behavior upon device restart, e.g. with an unmodified Samsung S3, a shortcut on the home screen will be renamed to the activity's label. (See https://stackoverflow.com/a/7250902)
The icon and label set for an intent filter are used to
represent a component whenever the component is
presented to the user as fulfilling the function advertised
by the filter. For example, a filter with
" android.intent.action.MAIN " and
" android.intent.category.LAUNCHER " settings
advertises an activity as one that initiates an
application — that is, as one that should be displayed in
the application launcher. The icon and label set in the
filter are therefore the ones displayed in the launcher.
Is there a way to change the name (Launcher App Label) of an app without creating a new project?
Note: Name of the App and The label shown on the Launcher Icon on Home Screen on Mobiles can be different.
Example: On the home page in my Mobile where my apps are, I have an icon and the name Foo, but I want to change the name to Bar. Can I do this?
Yes you can. By changing the android:label field in your application node in AndroidManifest.xml.
Note: If you have added a Splash Screen and added
<activity
android:name=".SplashActivity"
android:label="#string/title_activity_splash_screen"
android:theme="#style/AppTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
to your Splash Screen, then the Launcher Icon name will be changed to the name of your Splash Screen Class name.
Please make sure that you change label:
android:label="#string/title_activity_splash_screen"
in your Splash Screen activity in your strings.xml file. It can be found in Res -> Values -> strings.xml
See more here.
There's the android:label for the application, and the android:label for the launch activity. The former is what you see under Settings -> Applications -> Manage Applications on your device. The latter is what you see under Applications, and by extension in any shortcut to your application, e.g.
<application
android:label="#string/turns_up_in_manage_apps" >
<activity
android:name=".MainActivity"
android:label="#string/turns_up_in_shortcuts" >
...
</activity>
</application>
This is a simple thing in Android Studio,
go to: res folder -> values -> strings.xml
change the app_name (in the bellow example:MitsuhoSdn Bhd) to any new name you want.
<string name="app_name">MitsuhoSdn Bhd</string>
<string name="hello_world">Hello world!</string>
<string name="menu_settings">Settings</string>
I noticed there are some differences in how the app name can turn up in Lollipop devices. Before Lollipop, you can have different app names with this:
<application
android:label="#string/app_name"> // appears in manage app info
<activity
android:name=".MainActivity"
android:label="#string/action_bar_title"> // appears in actionbar title
<intent-filter android:label="#string/name_in_icon_launcher"> // appears in icon launcher
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
...
In Lollipop, it will be like this:
<application
android:label="#string/name_in_manage_app_info">
<activity
android:name=".MainActivity"
android:label="#string/name_in_actionbar_and_icon_launcher">
<intent-filter android:label="#string/this_is_useless">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
In Lollipop, android:label in intent-filter is basically useless, while actionbar title and icon launcher is identical. So, if you want a different title in actionbar, you have no choice but to set dynamically
getSupportActionBar().setTitle(R.string.app_name);
You might have to change the name of your main activity "android:label" also, as explained in Naming my application in android
It depends what you want to do. I personally wanted to rename my project so it didn't say MainActivity at the top of the app and underneath the icon on my phone menu.
To do this I went into the Android Manifest.xml file and edited
<activity
android:name=".MainActitivity"
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>
And edited the android:name=".Mynewname" and then edited the string title_activity_main in the strings.xml file to match the name.
Hope that helps!
if you want to change app name under launcher icon then change this android:label="#string/app_name"
inside your Main Launcher activity tag
<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 app name inside
Settings -> Application manager -> downloaded
where you have all installed applications then change this android:label="#string/app_name"
inside application tag
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
........
<activity android:name="com.test.app" >
</activity>
.......
</application>
To change the name of your Android application in Android Studio or Eclipse, you have to change the value of the property android:label defined inside the <application> node in AndroidManifest.xml
android:label="My Cool Application!"
by default the name of the application is referenced to a string defined in strings.xml file, for example:
android:label="#string/app_name"
so, we have to change the value inside the strings.xml file:
<string name="app_name">My Cool Application!</string>
<application
android:icon="#drawable/app_icon"
android:label="#string/app_name">
<activity
android:name="com.cipl.worldviewfinal.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>
</application>
To change android app's name , go to activity which is launcher activity and change its label like I have done above in my code.
If you're using android studio an item is under your strings.xml
<string name="app_name">BareBoneProject</string>
It's better to change the name here because you might have used this string somewhere.Or maybe a library or something has used it.That's it.Just build and run and you'll get new name.Remember this won't change the package name or anything else.
Nevermind I found it. It can be done in the manifest file under application just set the android label. Was thrown off at first becasue it didn't change my shortcut of the application's name.
Go to Strings.xml file under values.
Change the app_name tag to your app_name to want and it is all set, you will be able to see the name you change now.
follow the steps:(let I assuming you have chosen Android view)
app>res>values>strings
<string name="app_name">Put your App's new name here</string>
Edit the application tag in manifest file.
<application
android:icon="#drawable/app_icon"
android:label="#string/app_name"
android:theme="#android:style/Theme.Black.NoTitleBar.Fullscreen" >
Change the label attribute and give the latest name over there.
The change in Manifest file did not change the App name,
<application android:icon="#drawable/ic__logo" android:theme="#style/AppTheme" android:largeHeap="true" android:label="#string/app_name">
but changing the Label attribute in the MainLauncher did the trick for me .
[Activity(Label = "#string/app_name", MainLauncher = true, Theme = "#style/MainActivityNoActionBarTheme", ScreenOrientation = ScreenOrientation.Portrait)]
Old question but also now relative to Xamarin Android development:
As Xamarin allows for attributes to be used for adding items into the manifest, you may need to open your MainActivity.cs file and change the Label tag to your application's name:
Note: This attribute will override written android:label= tags in your manifest file as I found out whilst archiving the app ready for release so be sure to change this attribute too.
Yes Of-course........Android Supports to change the name of the App before making build just like iOS (Build Configuration).
You can change it by Modifying the Android manifest file for the project.
If you are here because when you tried to upload your fresh/brand new application using the play console it displayed this error:
"You must use another package name because "some.package.name" already exists in Google Play."
You just need to go to your build.gradle file (your application) and change
applicationId "some.package.name"
to
applicationId "some.package.different-unique-name"
Other answers here didn't fix this error.
in my case i need invalidate/cache and restart and its work
change the app string resource to your new activity