tags:

views:

46

answers:

2

The name of my Android app is 14 characters long with no spaces, as such, the full name is not visible on the home screen when displayed under the launcher icon.

I want to use an alternate name for displaying under the launcher icon, so I can break up the name into two strings separated by a space - so that the words should wrap.

How can this be done?

A: 

That text is in your AndroidManifest.xml at android:label:

<application android:icon="@drawable/icon" android:label="@string/app_name">

You should change that string to fix your issue.

Macarse
Since the manifest uses @string/app_name, you will actually want to change the name in the strings.xml resource file.
Guzba
Yes, I tried this, however when I do that it also changes the name that appears in the top of each activity, which up till now had always been the name of the application...so would that mean that I need to manually set a name in each activity to override the default behaviour?
@johnrock You can use a custom title bar.
Macarse
There's no need to write a bunch of code to create a custom title bar when all you need to do is have two separate string resources.
Lee
A: 

Modify your res\values\strings.xml to have two strings:

  1. app_name_wrappable = "App Name"
  2. app_name = "AppName"

Then modify your AndroidManifest.xml (or anywhere else you want the wrapping behavior) to read:

<application 
    android:icon="@drawable/icon" 
    android:label="@string/app_name_wrappable">

And leave everything else the same as it is currently.

Lee
-1: That will not change the behavior on the title bar.
Macarse
Yes, that's correct. He didn't want his title bar changed, just his launcher icon text changed. Your solution changed both.
Lee
@Lee: Title bar will get the text from `android:label` so adding other string to string.xml will not solve the issue.
Macarse
I figure the way to do it is set the label as mentioned here, then call setTitle in the activity to label each activity specifically
Wrong. Please take back the "right answer" mark!!
Zordid