Retrieving a string-array in xml file (res/values directory):
// Declare Resources object Resources res = null; // retrieve resources for project (usually in onCreate() or similar) res = getResources(); // assignment of strings into array String yourArray = res.getStringArray(R.array.yourArrayName); Retrieving single string (same requirements as above for Resources declaration and retrieval): String yourString = getString(R.string.yourStringName);
0 Comments
|
AuthorExploring Android and mobile web design, security, and development. Archives
March 2021
Categories |