Skip to content

Instantly share code, notes, and snippets.

@WrathChaos
Last active March 26, 2020 08:27
Show Gist options
  • Save WrathChaos/c1f4d664a6d36e59cc9e to your computer and use it in GitHub Desktop.
Save WrathChaos/c1f4d664a6d36e59cc9e to your computer and use it in GitHub Desktop.
Getting any string from string.xml on Android? Article: https://freakycoder.com/android-notes-4-getting-string-from-string-xml-370d4f25ade8
// string.xml PART
<string name="name0">Kuray OGUN</string>
<string name="nickname">FreakyCoder</string>

// In JAVA, getting the strings from string.xml
String name = getResources().getString(R.string.name0);
String nickname = getResources().getString(R.string.nickname);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment