diff --git a/OsmAnd/src/net/osmand/plus/myplaces/TrackActivityFragmentAdapter.java b/OsmAnd/src/net/osmand/plus/myplaces/TrackActivityFragmentAdapter.java index 0533a2360c..6390520bc1 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/TrackActivityFragmentAdapter.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/TrackActivityFragmentAdapter.java @@ -422,7 +422,7 @@ public class TrackActivityFragmentAdapter implements TrackBitmapDrawerListener { } } - private boolean isGpxFileSelected(GPXFile gpxFile) { + public boolean isGpxFileSelected(GPXFile gpxFile) { return gpxFile != null && ((gpxFile.showCurrentTrack && app.getSelectedGpxHelper().getSelectedCurrentRecordingTrack() != null) || (gpxFile.path != null && app.getSelectedGpxHelper().getSelectedFileByPath(gpxFile.path) != null)); diff --git a/OsmAnd/src/net/osmand/plus/myplaces/TrackPointFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/TrackPointFragment.java index f713fb8cab..a40b433830 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/TrackPointFragment.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/TrackPointFragment.java @@ -633,8 +633,19 @@ public class TrackPointFragment extends OsmandExpandableListFragment implements } updateSelectionMode(actionMode); } else { - if (item.group.getGpx() != null) { - app.getSelectedGpxHelper().setGpxFileToDisplay(item.group.getGpx()); + GPXFile gpx = item.group.getGpx(); + if (gpx != null) { + TrackActivity trackActivity = getTrackActivity(); + if (trackActivity != null && fragmentAdapter != null) { + boolean gpxFileSelected = fragmentAdapter.isGpxFileSelected(gpx); + if (!gpxFileSelected) { + Intent intent = trackActivity.getIntent(); + if (intent != null) { + intent.putExtra(TrackActivity.SHOW_TEMPORARILY, true); + } + } + } + app.getSelectedGpxHelper().setGpxFileToDisplay(gpx); } final OsmandSettings settings = app.getSettings(); LatLon location = new LatLon(item.locationStart.lat, item.locationStart.lon);