Beispiel #1
0
    @Override
    protected Weather doInBackground(String... params) {
      // TODO Auto-generated method stub

      String data = ((new WeatherHttpClient()).getWeatherData(params[0]));

      weather = JSONWeatherParser.getWeather(data);
      weather.iconData = weather.currCond.getIcon();

      Log.v("Data: ", weather.currCond.getDescription());

      new DownloadImageAsyncTask().execute(weather.iconData);
      return weather;
    }
Beispiel #2
0
    @Override
    protected Weather doInBackground(String... params) {

      String data = ((new WeatherHttpClient()).getWeatherData(params[0]));

      try {
        weather = JSONWeatherParser.getWeather(data);

        // Retrive the icon
        weather.iconData = weather.currentCondition.getIcon(); // ( (new
        // WeatherHttpClient()).getImage(weather.currentCondition.getIcon()));
        // weather.iconData = ( (new
        // WeatherHttpClient()).getImage(weather.currentCondition.getIcon()));
        Log.v("ICON DATA VALUE IS: ", String.valueOf(weather.currentCondition.getIcon()));

        // We call our ImageDownload task after the weather.iconData is set!
        new DownloadImageAsyncTask().execute(weather.iconData);

      } catch (JSONException e) {
        e.printStackTrace();
      }
      return weather;
    }