From eb7c83a6142e8c211db1a5bfd420530ab260d283 Mon Sep 17 00:00:00 2001 From: max-klaus Date: Wed, 2 Dec 2020 18:20:00 +0300 Subject: [PATCH] Fix #9869 --- .../osmand/plus/routepreparationmenu/cards/TracksCard.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/TracksCard.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/TracksCard.java index 3312371a56..5becff9bad 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/TracksCard.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/TracksCard.java @@ -62,10 +62,12 @@ public class TracksCard extends BaseCard { @SuppressLint("DefaultLocale") @Override protected void updateContent() { + String gpxDir = app.getAppPath(IndexConstants.GPX_INDEX_DIR).getAbsolutePath(); final List list = new ArrayList<>(); for (GPXFile gpx : gpxFiles) { File f = new File(gpx.path); - list.add(new GpxItem(GpxUiHelper.getGpxTitle(f.getName()), gpx, new GPXInfo(f.getName(), f.lastModified(), f.length()))); + String fileName = gpx.path.startsWith(gpxDir) ? gpx.path.substring(gpxDir.length() + 1) : f.getName(); + list.add(new GpxItem(GpxUiHelper.getGpxTitle(f.getName()), gpx, new GPXInfo(fileName, f.lastModified(), f.length()))); } Collections.sort(list, new Comparator() { @Override