I want to create a string-array inside another string-array like this:

<string-array name="names">
        <string-array name="man">
            <item>Jake</item>
          </string-array>
            <string-array name="woman">
            <item>Loise</item>
          </string-array>
</string-array>

But I don't know how to access to de string-array inside the main string-array. Before doing it this way, I had organized all names in the same string-array and I accessed this way:

String names[] = res.getStringArray(R.array.names);

But now I need to classify the data. How can I access to the SUB string-arrays?

Thank you in advance!

share|improve this question

79% accept rate
feedback

1 Answer

up vote 1 down vote accepted

The outer array should be an array, not a string array (since it's not holding strings anymore). You want to declare the string arrays separately, and then an array with references to these string arrays as described here (SO-thread, see accepted answer). Retrieval is also explained.

share|improve this answer
Thank you! :D Works like a charm! – KrLx_roller May 18 at 11:00
@KrLx_roller I can't really take full credit, but np. – Keyser May 18 at 11:00
feedback

Your Answer

 
or
required, but never shown
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.