document fix for "is no Attached" FC

This commit is contained in:
sonora 2014-12-30 10:10:31 +01:00
parent 40fa9e00fe
commit 91ba848d07

View file

@ -220,13 +220,13 @@ 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 // isAdded() here fixes the "not attached to Activity" FC when rapidly changing screen orientation
if (isAdded()) { 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;
} }
} }
}; };