This commit is contained in:
Vitaliy 2020-08-04 11:58:11 +03:00
parent b2118e6865
commit a56edc2f7a

View file

@ -1463,6 +1463,8 @@ public class MeasurementToolFragment extends BaseOsmAndFragment {
private ProgressDialog progressDialog; private ProgressDialog progressDialog;
private File toSave; private File toSave;
private boolean exportRouteAsGpx = false;
@Override @Override
protected void onPreExecute() { protected void onPreExecute() {
cancelModes(); cancelModes();
@ -1503,6 +1505,7 @@ public class MeasurementToolFragment extends BaseOsmAndFragment {
gpx.tracks.add(track); gpx.tracks.add(track);
} else if (saveType == SaveType.ROUTE_POINT) { } else if (saveType == SaveType.ROUTE_POINT) {
if (editingCtx.isInSnapToRoadMode()) { if (editingCtx.isInSnapToRoadMode()) {
exportRouteAsGpx = true;
editingCtx.exportRouteAsGpx(trackName, new ExportAsGpxListener() { editingCtx.exportRouteAsGpx(trackName, new ExportAsGpxListener() {
@Override @Override
public void onExportAsGpxFinished(GPXFile gpx) { public void onExportAsGpxFinished(GPXFile gpx) {
@ -1587,7 +1590,9 @@ public class MeasurementToolFragment extends BaseOsmAndFragment {
@Override @Override
protected void onPostExecute(Exception warning) { protected void onPostExecute(Exception warning) {
onGpxSaved(warning); if (!exportRouteAsGpx) {
onGpxSaved(warning);
}
} }
private void onGpxSaved(Exception warning) { private void onGpxSaved(Exception warning) {