From 86f1c66c10cbfe92cee344f64d9e706b84645db1 Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 26 May 2017 10:58:16 +0300 Subject: [PATCH] Fix #3603 --- .../net/osmand/plus/myplaces/AvailableGPXFragment.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java index 59a6be7ada..401dd3379f 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java @@ -1245,7 +1245,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment { @Override protected void onPreExecute() { - if (gpxInfo.file != null) { + if (gpxInfo.gpx == null && gpxInfo.file != null) { progressDialog = new ProgressDialog(getActivity()); progressDialog.setTitle(""); progressDialog.setMessage(getActivity().getResources().getString(R.string.loading_data)); @@ -1256,9 +1256,9 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment { @Override protected GpxDisplayItem doInBackground(Void... voids) { - GPXFile gpxFile; List gpxDisplayGroupList; if (gpxInfo.gpx == null) { + GPXFile gpxFile; if (gpxInfo.file == null) { gpxFile = getMyApplication().getSavingTrackHelper().getCurrentGpx(); } else { @@ -1285,6 +1285,9 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment { @Override protected void onPostExecute(GpxDisplayItem gpxItem) { + if (progressDialog != null) { + progressDialog.dismiss(); + } if (gpxItem != null && gpxItem.analysis != null) { ArrayList list = new ArrayList<>(); if (gpxItem.analysis.hasElevationData) { @@ -1306,10 +1309,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment { new PointDescription(PointDescription.POINT_TYPE_WPT, gpxItem.name), false, gpxItem); - progressDialog.dismiss(); MapActivity.launchMapActivityMoveToTop(getActivity()); - } else { - progressDialog.dismiss(); } } }