try fix FC "SearchTransportFragment{42a8c8d8} not attached to Activity" when quickly changing screen orientation on searchTransport screen

This commit is contained in:
sonora 2014-12-30 09:34:08 +01:00
parent 3f9f6c08f2
commit 9fdff2d9a7

View file

@ -220,12 +220,15 @@ public class SearchTransportFragment extends SherlockFragment implements SearchA
} }
@Override @Override
protected void onPostExecute(List<RouteInfoLocation> result) { protected void onPostExecute(List<RouteInfoLocation> result) {
// isAdded here tries to fix FC when rapidly changing screen orientation
if (isAdded()) {
stopsAdapter.setNewModel(result); stopsAdapter.setNewModel(result);
updateSearchMoreButton(); updateSearchMoreButton();
searchArea.setText(getSearchArea()); searchArea.setText(getSearchArea());
progress.setVisibility(View.INVISIBLE); progress.setVisibility(View.INVISIBLE);
asyncTask = null; asyncTask = null;
} }
}
}; };
asyncTask = current; asyncTask = current;
current.execute(rs.toArray(new TransportIndexRepository[rs.size()])); current.execute(rs.toArray(new TransportIndexRepository[rs.size()]));