Android: How Can I display all XML values of same tag name

前端 未结 4 1604
Happy的楠姐
Happy的楠姐 2021-01-20 15:43

I have the ff. XML from a URL:

 

    
                 


        
4条回答
  •  清酒与你
    2021-01-20 16:28

    You only have one ParsedExampleDataSet object in your handler, so there's only room to store one entry. Change ExampleHandler to have an ArrayList results and also a ParsedExampleDataSet currentSet. Inside startElement, when you see the PhoneBook tag, set currentSet to a new instance of ParsedExampleDataSet and add it to results. After parsing, results should contain everything you want.

提交回复
热议问题