Title: How to make the Java to call a String from a XML file(In Android Studio)
Tags: java;android;string
Question: I have this code and I will like to make it multi language app. What I want is to use the Strings from the Strings.xml file. How can i change "Colombian Peso" to String.

```        placeHolderData.add(new ExchangeListData("COP","Colombian Peso",R.drawable.colombia,time,"1"));
```


Here is the accepted answer: ```String string = getString(R.string.hello); // change hello to the right identifier
// then use it in your call
placeHolderData.add(new ExchangeListData("COP", string, R.drawable.colombia, time, "1"));
```

More info: https://developer.android.com/guide/topics/resources/string-resource#java

You can always change the ```R.string.hello``` identifier to the right language, i.e. ```R.string.es_peso```, based on the user locale, etc.


Here is another answer: Try this 

```
  String string = getResources().getString(R.string.hello);
```

Or

```
  String string = getString(R.string.hello);
```

to get String from String.xml &amp; add it to your desirable place 

```
  placeHolderData.add(new ExchangeListData("COP",string,R.drawable.colombia,time,"1"));
```

Comment for this answer: Thanks for your help

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 2, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2019:00:11/17/19', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<java><android><string>', 'Title': 'How to make the Java to call a String from a XML file(In Android Studio)', 'ViewCount': 102, 'id': 58906041, 'user_AboutMe': '', 'user_AccountId': 17120123.0, 'user_DisplayName': 'Nob', 'user_Reputation': 17.0, 'user_Views': 14.0, 'user_id': 12388558.0}}