Hesam
Hesam

Reputation: 53600

Changing the Title bar

In my program I have several activities. When I run the program, I have the name of application in Title bar (top of the screen).

How can I change this title with any text that I wish? I want to change the text of it for each activity.

Thanks

enter image description here

Upvotes: 0

Views: 504

Answers (2)

Dylan
Dylan

Reputation: 593

The title bar displays the property defined in android:label="" for each . If you'd like it to display the same name no matter the activity you could use android:label="@string/title_bar" which should point to a string that you've defined in res/values/strings.xml.

Upvotes: 2

Ye Myat Min
Ye Myat Min

Reputation: 1429

Put

setTitle(YOUR_ACTIVITY_NAME_HERE);

under onCreate method of your desired activity.

Upvotes: 4

Related Questions