From c066e737fe72258d1f19f79d16bab278c31c7cfa Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Tue, 11 Feb 2020 16:50:13 +0200 Subject: [PATCH] Fix #8269 --- OsmAnd-java/src/main/java/net/osmand/GPXUtilities.java | 2 ++ OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/GPXUtilities.java b/OsmAnd-java/src/main/java/net/osmand/GPXUtilities.java index d869b22eff..fe6d1336f1 100644 --- a/OsmAnd-java/src/main/java/net/osmand/GPXUtilities.java +++ b/OsmAnd-java/src/main/java/net/osmand/GPXUtilities.java @@ -1557,6 +1557,8 @@ public class GPXUtilities { serializer.endTag(null, "wpt"); //$NON-NLS-1$ } + writeExtensions(serializer, file); + serializer.endTag(null, "gpx"); //$NON-NLS-1$ serializer.endDocument(); serializer.flush(); diff --git a/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java b/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java index 2c98608e76..6eda756137 100644 --- a/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java +++ b/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java @@ -1119,7 +1119,7 @@ public class OsmandAidlApi { @SuppressLint("StaticFieldLeak") private void finishGpxImport(boolean destinationExists, File destination, String color, boolean show) { - int col = ConfigureMapMenu.GpxAppearanceAdapter.parseTrackColor( + final int col = ConfigureMapMenu.GpxAppearanceAdapter.parseTrackColor( app.getRendererRegistry().getCurrentSelectedRenderer(), color); if (!destinationExists) { GpxDataItem gpxDataItem = new GpxDataItem(destination, col); @@ -1145,6 +1145,9 @@ public class OsmandAidlApi { @Override protected void onPostExecute(GPXFile gpx) { if (gpx.error == null) { + if (col != -1) { + gpx.setColor(col); + } selectedGpx.setGpxFile(gpx, app); refreshMap(); }