R.string to string R.array to array Android

R.string to string Android source code
R.array to string [] Android source code

String s = getResources().getString(R.string.my_string); // Hello world!!
String[] arrayOfStrings = getResources().getStringArray(R.array.my_array); // one, two
<xml version="1.0" encoding="utf-8">
<resources>
    <string-array name="my_array">
        <item>one</item>
        <item>two</item>
    </string-array>
<string name="my_string">Hello world!!</string>
</resources>
This entry was posted in Android Examples Code, Array,List,Collections and tagged , . Bookmark the permalink.


Comments are closed.

3,777 views