diff --git a/Hyperrail/src/main/java/be/hyperrail/android/DisturbanceListFragment.java b/Hyperrail/src/main/java/be/hyperrail/android/DisturbanceListFragment.java index cebfe9f0..ef3bfc55 100644 --- a/Hyperrail/src/main/java/be/hyperrail/android/DisturbanceListFragment.java +++ b/Hyperrail/src/main/java/be/hyperrail/android/DisturbanceListFragment.java @@ -92,7 +92,7 @@ public void onRefresh() { adapter.setOnItemClickListener(this); vRecyclerView.setAdapter(adapter); - if (savedInstanceState != null) { + if (savedInstanceState != null && savedInstanceState.containsKey("updated")) { this.disturbances = (Disturbance[]) savedInstanceState.getSerializable("disturbances"); this.lastUpdate = new DateTime(savedInstanceState.getLong("updated")); this.setData(this.disturbances); @@ -104,8 +104,10 @@ public void onRefresh() { @Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); - outState.putSerializable("disturbances", disturbances); - outState.putLong("updated", lastUpdate.getMillis()); + if (lastUpdate != null) { + outState.putSerializable("disturbances", disturbances); + outState.putLong("updated", lastUpdate.getMillis()); + } } private void loadDisturbances() { diff --git a/Hyperrail/src/main/java/be/hyperrail/android/LiveboardSearchFragment.java b/Hyperrail/src/main/java/be/hyperrail/android/LiveboardSearchFragment.java index 93bf16a5..8c0435ec 100644 --- a/Hyperrail/src/main/java/be/hyperrail/android/LiveboardSearchFragment.java +++ b/Hyperrail/src/main/java/be/hyperrail/android/LiveboardSearchFragment.java @@ -120,7 +120,6 @@ public void onViewCreated(final View view, @Nullable Bundle savedInstanceState) registerForContextMenu(stationRecyclerView); mStationAdapter = new StationCardAdapter(this.getActivity(), null); - mStationAdapter.setOnItemClickListener(this); mStationAdapter.setOnLongItemClickListener(this); stationRecyclerView.setAdapter(mStationAdapter); @@ -197,7 +196,6 @@ private void loadStations(String s) { @Override public void onStart() { super.onStart(); - setSuggestedStations(); mGoogleApiClient.connect(); }