here suppose I have an xml file in the android project.

<people> <name>denis</name> <name>ivan</name> </people> <people> <name>bobic</name> <name>sharick</name> </people> 

How to translate all data into a string array?

PS I did not understand myself with how to use SAX. Guys, I need a code, not a link to training materials. There for examples of parsing lead complex xml structures with a bunch of different tags without explaining the code. It seems: "here is an example, everything is clear" Please, it is very necessary.

1 answer 1

You need to use the structure:

 <resources> <string-array name="people"> <name>denis</name> <name>ivan</name> </string-array> </resources> 

and translate into an array:

 String[] array = getResources().getStringArray(R.array.people) 
  • tim_taller thanks dude!))) thanks a lot - Ivan
  • @ Ivan, if the answer helped you, then mark it as a solution to the question (a tick under the number of votes). - EgorD