Android xml Array returning 0 for getIndexCount()

Posted by user1459976 on Stack Overflow See other posts from Stack Overflow or by user1459976
Published on 2013-07-02T16:50:59Z Indexed on 2013/07/02 17:05 UTC
Read the original article Hit count: 176

Filed under:
|
|

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?

© Stack Overflow or respective owner

Related posts about android

Related posts about Xml