Android xml Array returning 0 for getIndexCount()
- by user1459976
i'm storing data in an xml array in this fashion
<resources>
<array name="myarray">
<item>
<item>attribute1</item>
<item>attribute2</item>
<item>and so on</item>
</item>
<item>
<item>attribute1</item>
<item>attribute2</item>
<item>and so on</item>
</item>
<item>
<item>attribute1</item>
<item>attribute2</item>
<item>and so on</item>
</item>
</array>
</resources>
// in program
TypedArray array = getResources().obtainTypedArray(R.array.myarray);
when i call array.getIndexCount() in the program it returns 0, what is wrong?