use of tk.woppo.sunday.model.city.ProvicneModel in project SunDay by iQuick.
the class CitySaxParseHandler method startElement.
@Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
super.startElement(uri, localName, qName, attributes);
// LogUtil.i(TAG, "start read tag - " + localName);
this.tagName = localName;
if (tagName.equalsIgnoreCase("province")) {
//省
mProvicneModel = new ProvicneModel();
mProvicneModel.setCityName(attributes.getValue("name"));
mProvicneModel.setCityId(attributes.getValue("id"));
} else if (tagName.equalsIgnoreCase("city")) {
//市
mCityModel = new CityModel();
mCityModel.setCityName(attributes.getValue("name"));
mCityModel.setCityId(attributes.getValue("id"));
} else if (tagName.equalsIgnoreCase("county")) {
//区/县
mAreaModel = new AreaModel();
mAreaModel.setCityName(attributes.getValue("name"));
mAreaModel.setCityId(attributes.getValue("id"));
mAreaModel.setWeatherCode(attributes.getValue("weatherCode"));
}
}
Aggregations