Jana
Jana

Reputation: 2920

Android How to change the application title

HI I need to change the application title as when i move to new tab.

i tried to change the app_name with varying string in string.xml but that is not actual dynamic change that i want.

is there any alternative way of doing this?

Upvotes: 20

Views: 46732

Answers (3)

Julian
Julian

Reputation: 20324

You can simply call the setTitle() function from within your Activity. It takes either an int (resource ID) or a CharSequence as a parameter.

Upvotes: 34

Praveen
Praveen

Reputation: 91175

then you have to set the custom title for your app. check my post.

You have to set a custom layout for your title. you can access the TextView object from that.

Edit:

Accept Apologize. i didnt read the question propely.

setTitle() method is enough. My answer is about to customizing the title.that is color, text size and all.

Upvotes: 3

nixa
nixa

Reputation: 133

android:label in AndroidManifest.xml is using reference to @string/app_name for user readable application name (app name in applications list or name under icon on main screen if you add shoutcut)

For changing Activity title you should use setTitle() of Activity class.

Upvotes: 7

Related Questions