protected void runWeatherUpdate() { LoadingListener<WeatherForecast> listener = new LoadingListener<WeatherForecast>() { @Override public void onLoaded(WeatherForecast result) { updateWeatherInfo(result); } @Override public void notifyStart() { OWAnimationUtils.startRotation(ivRefreshIndicator); String locationName = mConfiguration.getLocationName(); locationName = (locationName == null) ? "" : locationName; tvLocationName.setText(locationName); updateLayout.setVisibility(View.VISIBLE); } @Override public void notifyStop() { ivRefreshIndicator.clearAnimation(); updateLayout.setVisibility(View.GONE); } }; dataManager.runUpdate(listener); }
@Override public void onResume() { super.onResume(); dataManager.getWeatherForecast(listener); }