-2

Hello I have a problem in calling the name of the application

enter image description here

I need to invoke the application of MainActivity name <String xxx>

<resources>
     <string name="app">@layout/activity_main/@xxx</string>
</resources>

Is this possible
I do not want to use

<string name="app">name</string>
GSerg
  • 76,472
  • 17
  • 159
  • 346
Ha7
  • 11
  • 3

1 Answers1

1

You got it wrong. It is actually the opposite way.

In strings.xml you declare:

<string name="app">Application name</string>

An in the activity you read:

getString(R.string.app);
Rafael Lucena
  • 635
  • 1
  • 6
  • 9
  • But when the application is installed, the following name will appear Application name I want to call the name of the variable text MainActivity Is this thing is possible or not. – Ha7 Apr 14 '16 at 12:44
  • Do you mean that you want to change the application name during runtime?? – Rafael Lucena Apr 14 '16 at 12:46
  • Yes, I want to change the name of the application during installation on the phone, but I need the name of the application was summoned private String xxx – Ha7 Apr 14 '16 at 12:51
  • take a look at this http://stackoverflow.com/questions/24345068/how-to-change-android-application-name-and-icon-at-runtime – Rafael Lucena Apr 14 '16 at 12:59