Beispiel #1
0
 private void getWeatherInfoFromXML() {
   mAddressCityNameHan = citiesList.get(currentIndex);
   try {
     GetWeatherInfo getweatherInfo = new GetWeatherInfo();
     String cityCode = cityDB.getCity(mAddressCityNameHan).getCityNumber();
     getweatherInfo.queryWeatherCode(cityCode, mainHandler);
   } catch (Exception e) {
     e.printStackTrace();
     Log.d("Lesshst, error: ", e.toString());
   }
 }
    @Override
    public void run() {
      String temp = "";

      try {
        GetWeatherInfo getweatherInfo = new GetWeatherInfo();
        getweatherInfo.queryWeatherCode("101010100", mainHandler);

      } catch (Exception e) {
        e.printStackTrace();
        remoteViews.setTextViewText(R.id.temperature, city + ":-5℃");
        appWidgetManager.updateAppWidget(thisWidget, remoteViews);
      }
    }