private Forecast parseForecast(String jsonData) throws JSONException { Forecast forecast = new Forecast(); forecast.setCurrent(getCurrentDetails(jsonData)); forecast.setHourlyForecast(getHourlyForecast(jsonData)); forecast.setDailyForecast(getDailyForecast(jsonData)); return forecast; }
private void updateDisplay() { Current current = mForecast.getCurrent(); mTemperatureLabel.setText(current.getTemperature() + ""); mSummaryLabel.setText(current.getSummary()); mTimeLabel.setText(current.getFormattedTime()); mHumidityValue.setText(current.getHumidity() + ""); mPrecipValue.setText(current.getPrecipChance() + "%"); mLocationLabel.setText(current.getTimeZone()); mIconImageView.setImageResource(current.getIconId()); }
public void startHourlyActivity(View view) { Intent intent = new Intent(this, HourlyForecastActivity.class); intent.putExtra(HOURLY_FORECAST, mForecast.getHourlyForecast()); startActivity(intent); }
public void startDailyActivity(View view) { Intent intent = new Intent(this, DailyForecastActivity.class); intent.putExtra(DAILY_FORECAST, mForecast.getDailyForecast()); startActivity(intent); }