android how to properly remove data list in circulation

Solutions are as follows:

 Logs.e("initData1=="+new Gson().toJson(cityList));
        Iterator item = cityList.iterator();
        while (item.hasNext()) {
            CityModel model = (CityModel) item.next();
            model.setPinyin(CnToCharUntil.getSpell(model.getPinyin(),true));
            if (model.getLat()==0||model.getLng()==0) {
                item.remove();
            }
        }

 

Published 49 original articles · won praise 2 · Views 8615

Guess you like

Origin blog.csdn.net/yangjunjin/article/details/99691124