diff --git a/OsmAnd/src/net/osmand/plus/myplaces/tracks/dialogs/SplitSegmentDialogFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/tracks/dialogs/SplitSegmentDialogFragment.java index 8bc939cb386..7cc61d281f3 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/tracks/dialogs/SplitSegmentDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/tracks/dialogs/SplitSegmentDialogFragment.java @@ -36,6 +36,7 @@ import net.osmand.plus.track.SplitTrackAsyncTask.SplitTrackListener; import net.osmand.plus.track.helpers.GpxDisplayGroup; import net.osmand.plus.track.helpers.GpxDisplayItem; +import net.osmand.plus.track.helpers.GpxSelectionHelper; import net.osmand.plus.track.helpers.GpxSelectionHelper.GpxDisplayItemType; import net.osmand.plus.track.helpers.SelectedGpxFile; import net.osmand.plus.track.helpers.TrackDisplayGroup; @@ -198,8 +199,13 @@ private void updateHeader() { R.layout.popup_list_text_item, options)); popup.setOnItemClickListener((parent, view, position, id) -> { selectedSplitInterval = position; - GpxSelectionParams params = GpxSelectionParams.getDefaultSelectionParams(); - SelectedGpxFile sf = app.getSelectedGpxHelper().selectGpxFile(getGpx(), params); + GpxFile gpxFile = getGpx(); + GpxSelectionHelper gpxSelectionHelper = app.getSelectedGpxHelper(); + SelectedGpxFile sf = gpxSelectionHelper.getSelectedFileByPath(gpxFile.getPath()); + if (sf == null) { + GpxSelectionParams params = GpxSelectionParams.getDefaultSelectionParams(); + sf = gpxSelectionHelper.selectGpxFile(gpxFile, params); + } List groups = getDisplayGroups(); if (groups.size() > 0) { updateSplit(groups, sf);