Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

I make the apps using a test name ~ But now I want to change the name ~ I can find the way to change it~

I have already changed the package name ~and also the name in the strings.xml ~ the name of the apps still does not change ~ i have also try to clean the apps already ~ Please help me ~ what should I do ?

3 Answers

Crisoforo Gaspar Hernández
Crisoforo Gaspar Hernández
18,302 Points

Just change the value of android:label="AppName" inside the AndroidManifest.xml file.

You can learn more about this attribute in the android developer website

If i'm not mistaken you need to change it in the android manifest. I could be wrong I will have to check in a little bit.

Harry James
Harry James
14,780 Points

The name is set in the AndroidManifest.xml file. Where it says Label, replace the text with the name of your app. But wait! If you try that out now, it won’t make a difference. That’s because the activity launched when the app is first started will override the app’s label with its own.

This means that the MainActivity label is overriding the app label that we just set. If your app only has 1 activity (Like the Crystal Ball app), you can just clear it out. Clearing it out will set the default to the Application Attribute Label.

But, what if you have more than 1 activity? How can you tell which is the main one that gets launched when the app is started? If you scroll to the bottom and look at the Application Nodes, you will see the MainActivity class. You can expand this and see what’s called an Intent Filter and, if you expand that as well, you will find the MAIN action and LAUNCHER category. This MAIN, LAUNCHER combination gets set on the activity that is started when the app is launched. If you have more than one activity in your app, you can move the Intent Filter to the activity that you want. Then, this activity would be set as the main activity.

Another thing is that if you have the MAIN, LAUNCHER combination more than once then, you would see 2 different apps on the app screen.

Also, as for the Application Package, if you wish to change that, Right click on your Project and select Android Tools. Then, press Rename Application Package.