another solution to issue fix
This commit is contained in:
parent
caa2c08454
commit
6dfc75fd28
3 changed files with 10 additions and 13 deletions
|
@ -69,12 +69,6 @@ public class GpxSelectionHelper {
|
|||
saveCurrentSelections();
|
||||
}
|
||||
|
||||
public void clearAllGpxFilesWithoutBackup() {
|
||||
selectedGpxFilesBackUp.clear();
|
||||
selectedGPXFiles = new ArrayList<>();
|
||||
saveCurrentSelections();
|
||||
}
|
||||
|
||||
public void restoreSelectedGpxFiles() {
|
||||
for (Entry<GPXFile, Long> gpxEntry : selectedGpxFilesBackUp.entrySet()) {
|
||||
if (!Algorithms.isEmpty(gpxEntry.getKey().path)) {
|
||||
|
|
|
@ -161,6 +161,7 @@ public class ConfigureMapMenu {
|
|||
for (GpxSelectionHelper.SelectedGpxFile file : selectedGpxFiles) {
|
||||
files.add(file.getGpxFile().path);
|
||||
}
|
||||
if (selectedGpxFiles.isEmpty()) {
|
||||
Map<GPXUtilities.GPXFile, Long> fls = selectedGpxHelper.getSelectedGpxFilesBackUp();
|
||||
for(Map.Entry<GPXUtilities.GPXFile, Long> f : fls.entrySet()) {
|
||||
if(!Algorithms.isEmpty(f.getKey().path)) {
|
||||
|
@ -170,6 +171,8 @@ public class ConfigureMapMenu {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return files;
|
||||
}
|
||||
|
||||
|
|
|
@ -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().clearAllGpxFilesWithoutBackup();
|
||||
app.getSelectedGpxHelper().clearAllGpxFileToShow();
|
||||
}
|
||||
if (app != null && showCurrentGpx && adapter.getItem(0).getSelected()) {
|
||||
currentGPX = app.getSavingTrackHelper().getCurrentGpx();
|
||||
|
|
Loading…
Reference in a new issue