Пример #1
0
 private void queryCity() {
   cityList = db.getCities(selectedProvince.getId());
   if (cityList.size() > 0) {
     dataList.clear();
     for (City c : cityList) {
       dataList.add(c.getCityName());
     }
     adapter.notifyDataSetChanged();
     listview.setSelection(0);
     title.setText(selectedProvince.getProvinceName());
     currentLevel = LEVEL_CITY;
   } else {
     queryServer(selectedProvince.getProvinceCode(), "city");
   }
 }
Пример #2
0
  private void queryCities() {
    // TODO Auto-generated method stub
    cityList = coolWeatherDB.loadCities(selectedProvince.getId());
    if (cityList.size() > 0) {
      dataList.clear();
      for (City city : cityList) {
        dataList.add(city.getCityName());
      }
      adapter.notifyDataSetChanged();
      listView.setSelection(0);
      titleText.setText(selectedProvince.getProvinceName());
      currentLevel = LEVEL_CITY;

    } else {
      queryFromServer(selectedProvince.getProvinceCode(), "city");
    }
  }