It doesn't seem possible, but I was hoping someone may be aware of a way. Can the label of the application (the one defined in the manifest file by android:label="@string/app_name"
) be set from code?
Asked
Active
Viewed 1.0k times
3 Answers
29
That is read-only, AFAIK.
If your objective is to change the title bar of your activities, you can call setTitle()
.

CommonsWare
- 986,068
- 189
- 2,389
- 2,491
-
Possibly there is a way to modify the value of a string resource from code? – ab11 Jan 24 '12 at 17:56
-
1@ab11: That's *definitely* not possible. – CommonsWare Jan 24 '12 at 18:01
-
2it works... to be more precise, use `getActionBar().setTitle("bla bla bla");` – Ricardo Appleton Aug 06 '14 at 20:53
-
@RicardoAppleton: The OP is specifically *not* referring to the action bar, but rather other uses of that string resource. – CommonsWare Aug 06 '14 at 21:00
2
I mostly use this to change actionBar's text pragmatically in onCreate() method....very easy!
getSupportActionBar().setTitle("yourString");

Zohab Ali
- 8,426
- 4
- 55
- 63