From 04410eed3c1e9cdb73334aaea9c41fafc99f03da Mon Sep 17 00:00:00 2001 From: Denis Date: Fri, 5 Sep 2014 13:31:09 +0300 Subject: [PATCH] Fixed bug when user try to start route without gpx file --- .../net/osmand/plus/sherpafy/SherpafyStageFragment.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyStageFragment.java b/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyStageFragment.java index 3c1f7c23fa..3377678b4b 100644 --- a/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyStageFragment.java +++ b/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyStageFragment.java @@ -3,6 +3,7 @@ package net.osmand.plus.sherpafy; import java.lang.reflect.Field; import java.util.ArrayList; +import android.widget.Toast; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.sherpafy.TourInformation.StageFavoriteGroup; @@ -105,7 +106,11 @@ public class SherpafyStageFragment extends SherlockFragment { ((TourViewActivity) getSherlockActivity()).selectMenu(tour); return true; } else if(item.getItemId() == START) { - ((TourViewActivity) getSherlockActivity()).startStage(stage); + if (stage.gpxFile != null){ + ((TourViewActivity) getSherlockActivity()).startStage(stage); + } else{ + Toast.makeText(app, R.string.gpx_files_not_found, Toast.LENGTH_LONG).show(); + } return true; } else if(item.getItemId() == NEXT_STAGE) { ((TourViewActivity) getSherlockActivity()).selectMenu(customization.getNextAvailableStage(tour));