tags:

views:

316

answers:

2

Hi,

I want to get an array of strings reading from arrays.xml file we add in android values/ folder. Could any one kindly give a solution for this. Otherwise I will have to input each these entries in strings.xml and take them to java code using getResources()getString()

Thank you. Tharindu

A: 

I don't have an IDE in front of me right now, but I think you should be able to do something like R.res.arrays.YOUR_ARRAY_OF_STRINGS.

broschb
But it is only an integer I think, I need the content of the array :( thought there should be an easy way other than getting all array elements reading from 'strings.xml'
Tharindu Madushanka
You can do it by doing the following:String[] arrayContents = getResources.getStringArray(R.array.arrayname);
broschb
A: 

thanks getResources().getStringArray(R.array.umc_profile_values) worked 4 me!!!!!!

piyushnp