android开发:xml解析读取的方法XmlResourceParser、XmlPullParser

public Object parserXml(XmlResourceParser xml){

ArrayList
_list = new ArrayList<>();//三维数组对象
ArrayList
_city = new ArrayList<>(); //城市二维数组对象

areaInfo province = new areaInfo(); //省份对象
areaInfo city = new areaInfo(); //城市对象

try {

while (xml.getEventType() != XmlResourceParser.END_DOCUMENT){ //XML开始解析

String name = null;

 
Copyright © 2008-2021 lanxinbase.com Rights Reserved. | 粤ICP备14086738号-3 |