Issue
I have an array of titles in my strings.xml file. I want to add these titles from the XML file to a ListView in my Activity. How can I do that? Please help me with some example.
Solution
You can do it as:
In your Activity class,
private String[] items;
And inside onCreate() method, initialize items array:
items = getResources().getStringArray(R.array.<your-string-array-name>);
And use this items array with your adapter.
Answered By - Vamsi
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.