diff --git a/OsmAnd/src/net/osmand/plus/GpxSelectionHelper.java b/OsmAnd/src/net/osmand/plus/GpxSelectionHelper.java index 36af56140b..c9fd85314b 100644 --- a/OsmAnd/src/net/osmand/plus/GpxSelectionHelper.java +++ b/OsmAnd/src/net/osmand/plus/GpxSelectionHelper.java @@ -69,6 +69,12 @@ public class GpxSelectionHelper { saveCurrentSelections(); } + public void clearAllGpxFilesWithoutBackup() { + selectedGpxFilesBackUp.clear(); + selectedGPXFiles = new ArrayList<>(); + saveCurrentSelections(); + } + public void restoreSelectedGpxFiles() { for (Entry gpxEntry : selectedGpxFilesBackUp.entrySet()) { if (!Algorithms.isEmpty(gpxEntry.getKey().path)) { diff --git a/OsmAnd/src/net/osmand/plus/helpers/GpxUiHelper.java b/OsmAnd/src/net/osmand/plus/helpers/GpxUiHelper.java index c3f5976c4a..abfc6d3ea4 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/GpxUiHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/GpxUiHelper.java @@ -613,7 +613,7 @@ public class GpxUiHelper { //clear all previously selected files before adding new one OsmandApplication app = (OsmandApplication) activity.getApplication(); if (app != null && app.getSelectedGpxHelper() != null) { - app.getSelectedGpxHelper().clearAllGpxFileToShow(); + app.getSelectedGpxHelper().clearAllGpxFilesWithoutBackup(); } if (app != null && showCurrentGpx && adapter.getItem(0).getSelected()) { currentGPX = app.getSavingTrackHelper().getCurrentGpx();