From: gu.martinm@gmail.com Date: Mon, 22 Sep 2014 01:39:15 +0000 (+0200) Subject: WeatherInformation: overview X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=d69817600cb7e9bb90171732ff09bdad7d01ded9;p=JavaForFun WeatherInformation: overview 1. setListShownNoAnimation did not work as expected (something usual in Android) 2. When error, show message and remove progress bar. --- diff --git a/Android/WeatherInformation/src/de/example/exampletdd/fragment/overview/OverviewFragment.java b/Android/WeatherInformation/src/de/example/exampletdd/fragment/overview/OverviewFragment.java index 2621758..88d4863 100644 --- a/Android/WeatherInformation/src/de/example/exampletdd/fragment/overview/OverviewFragment.java +++ b/Android/WeatherInformation/src/de/example/exampletdd/fragment/overview/OverviewFragment.java @@ -105,7 +105,12 @@ public class OverviewFragment extends ListFragment { final WeatherLocation weatherLocation = query.queryDataBase(); weatherLocation.setLastForecastUIUpdate(new Date()); query.updateDataBase(weatherLocation); + + // Show list. + OverviewFragment.this.setListShownNoAnimation(true); } else { + // Empty list and show error message (see setEmptyText in onCreate) + OverviewFragment.this.setListAdapter(null); OverviewFragment.this.setListShownNoAnimation(true); } }