Click here to Skip to main content
12,956,257 members (64,378 online)
Click here to Skip to main content
Add your own
alternative version


4 bookmarked
Posted 16 May 2014

Change an Android Layout's default header text

, 16 May 2014 CPOL
Rate this:
Please Sign up or sign in to vote.
How to quickly and easily change a Layout's header text

I Don't Know What to Call This Guy...

When you create an Activity/Layout pair, the default text defining the Layout (the name of the Activity) will display to the right of the cute little green Android with the transparent belly who seems to have swallowed a di[c]e which has had the dye inside its debossed divits worn away by robot stomach acid (or is that simply an upside-down peace sign?)*:

* There must be an official moniker for the glyph of that cute li'l feller, but I obviously don't know what it is.

It could be that the text shown is something that is not human-friendly, such as "DeliveryItemActivity".

...But Changing the Text is as Easy as Pie

If so, and you want it to be something else, perhaps just inserting spaces between the words (such as "Delivery Item Activity"), or even change it to something totally different, here is how you do that:

Open the strings.xml file (beneath [projectName]\app\src\main\res\values) and locate the string value that you want to replace. In the example given, it is:

<string name="title_activity_delivery_item">DeliveryItemActivity</string>

Now change it to:

<string name="title_activity_delivery_item">New Delivery</string>

..and voila! The Layout now bears that new text description to your right/the left of your little green buddy:

Of course, the text you use is up to you - you could make it "Zombies: Time of the Season, She's Not There, Tell Her No" if you wanted to.

Hopefully, that great and vastly underappreciated band will get back together and release an album entitled "Apocalypse"!


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

B. Clay Shannon
Founder Across Time & Space
United States United States
I am in the process of morphing from a software developer into a portrayer of Mark Twain. My monologue (or one-man play, entitled "The Adventures of Mark Twain: As Told By Himself" and set in 1896) features Twain giving an overview of his life up till then. The performance includes the relating of interesting experiences and humorous anecdotes from Twain's boyhood and youth, his time as a riverboat pilot, his wild and woolly adventures in the Territory of Nevada and California, and experiences as a writer and world traveler, including recollections of meetings with many of the famous and powerful of the 19th century - royalty, business magnates, fellow authors, as well as intimate glimpses into his home life (his parents, siblings, wife, and children).

Peripatetic and picaresque, I have lived in eight states; specifically, besides my native California (where I was born and where I now again reside) in chronological order: New York, Montana, Alaska, Oklahoma, Wisconsin, Idaho, and Missouri.

I am also a writer of both fiction (for which I use a nom de plume, "Blackbird Crow Raven", as a nod to my Native American heritage - I am "½ Cowboy, ½ Indian") and nonfiction, including a two-volume social and cultural history of the U.S. which covers important events from 1620-2006:

You may also be interested in...

Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170525.1 | Last Updated 16 May 2014
Article Copyright 2014 by B. Clay Shannon
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid