From c4a6fb84498c484a5b7aeb4e712a3a2b03996b8a Mon Sep 17 00:00:00 2001 From: nazar-kutz Date: Sun, 29 Sep 2024 19:53:51 +0300 Subject: [PATCH] Fix "Analyze by intervals - "None" does not work #20503" --- .../tracks/dialogs/SplitSegmentDialogFragment.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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);