java - Using strings.xml items on a listview array -
i'm coding android app android studio. i'm displaying listview gets content string array. want use strings.xml items in array of listview, can't. please me. i'm doing first item of array:
public final string palanca= (getresources().getstring(r.string.palanca)); private string [] formls = {palanca,"@string/umr","@string/new1","@string/new2","@string/new3"};
thank you!
create string array resource in strings.xml.
<string-array name="colors"> <item>red</item> <item>green</item> <item>blue</item> </string-array>
use string array java other string resource.
private string[] colors = getresources().getstringarray(r.array.colors);