Skip to content

Commit

Permalink
Merge pull request #53 from hyperrail/development
Browse files Browse the repository at this point in the history
Fix stability issues
  • Loading branch information
Bertware authored Sep 25, 2017
2 parents 7850e65 + 2cf6cad commit 55afd9a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -197,7 +196,6 @@ private void loadStations(String s) {
@Override
public void onStart() {
super.onStart();
setSuggestedStations();
mGoogleApiClient.connect();
}

Expand Down

0 comments on commit 55afd9a

Please sign in to comment.