How getting an array of xml file from android resource?

robarsawei

New Member
I have this array into my resource file :\[code\]<array name="xml_data"> <item>@xml/data1</item> <item>@xml/data2</item> <item>@xml/data3</item> <item>@xml/data4</item></array>\[/code\]Normally, it's not different from an normal array, but when getting in code, this doesn't work...\[code\]int[] xmlList = res.getIntArray(R.array.xml_data);Log.i(TAG, "Data found: "+ xmlList.length);for (int i = 0; i < xmlList.length; i++) { Log.i(TAG, "Extract xml id="+ xmlList.);}\[/code\]Here is the output obtained in the logcat :\[code\]Data found: 4Extract xml id=0Extract xml id=0Extract xml id=0Extract xml id=0\[/code\]Can you help me about this?Thanks.
 
Back
Top