public static void update(List<String> citys) { selected = new boolean[citys.size()]; Map<String, WeatherSet> data = LocalWeatherManager.loadWeatherData(context); Set<String> hash = new TreeSet<String>(); if (data != null) { for (WeatherSet set : data.values()) { hash.add(set.getCityCn()); } } for (int i = 0; i < citys.size(); i++) { if (hash.contains(citys.get(i))) { selected[i] = true; } } }