Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android How to change the application title

Tags:

android

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?

like image 652
Jana Avatar asked Oct 20 '10 07:10

Jana


People also ask

Can I change application name in Android?

Yes you can. By changing the android:label field in your application node in AndroidManifest. xml . to your Splash Screen, then the Launcher Icon name will be changed to the name of your Splash Screen Class name.

How do I change the name of an Android app icon?

Choose the Apps option for an app icon. Next, select the app icon you want to customize from the list of installed apps. Use the Tap to Edit Label button (it will also show the app name) to change the name. Then, enter the new custom name or label and select Done.


2 Answers

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

like image 70
Julian Avatar answered Sep 20 '22 22:09

Julian


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.

like image 23
nixa Avatar answered Sep 19 '22 22:09

nixa