fixed null reference on selecting same stage. fixed null reference when rotating phone during change stage opration

This commit is contained in:
unknown 2014-06-04 15:10:56 +03:00
parent 683add9045
commit abeb283fd9

View file

@ -436,12 +436,23 @@ public class TourViewActivity extends SherlockFragmentActivity {
@Override
protected Void doInBackground(TourInformation... params) {
//if tour is already selected - do nothing
if (customization.getSelectedTour()!= null){
if (customization.getSelectedTour().equals(params[0])){
return null;
}
}
customization.selectTour(params[0], IProgress.EMPTY_PROGRESS);
return null;
}
protected void onPostExecute(Void result) {
//to avoid illegal argument exception when rotating phone during loading
try {
dlg.dismiss();
} catch (Exception ex){
}
startTourView();
};
}.execute(tour);