WeatherInformation: overview
authorgu.martinm@gmail.com <gu.martinm@gmail.com>
Mon, 22 Sep 2014 01:39:15 +0000 (03:39 +0200)
committergu.martinm@gmail.com <gu.martinm@gmail.com>
Mon, 22 Sep 2014 01:39:15 +0000 (03:39 +0200)
1. setListShownNoAnimation did not work as expected (something usual in Android)
2. When error, show message and remove progress bar.

src/de/example/exampletdd/fragment/overview/OverviewFragment.java

index 2621758..88d4863 100644 (file)
@@ -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);
                                        }
                                }