diff --git a/src/main/java/de/blau/android/Main.java b/src/main/java/de/blau/android/Main.java index 18add49c9..c2a9b5764 100644 --- a/src/main/java/de/blau/android/Main.java +++ b/src/main/java/de/blau/android/Main.java @@ -2159,19 +2159,22 @@ public void onError(String message) { if (prefs.getEgmFile() == null && getString(R.string.gps_source_internal).equals(prefs.getGpsSource())) { tipKeys.add(R.string.tip_gpx_no_elevation_key); tipMessageIds.add(R.string.tip_gpx_no_elevation); - } + } if (haveTracker && haveLocationProvider(getEnabledLocationProviders(), LocationManager.GPS_PROVIDER)) { getTracker().startTracking(); setFollowGPS(true); } addGpxLayer(); - mapLayout.post(()->Tip.showDialog(Main.this, tipKeys, tipMessageIds)); + mapLayout.post(() -> { + triggerMenuInvalidation(); + Tip.showDialog(Main.this, tipKeys, tipMessageIds); + }); return true; case R.id.menu_gps_pause: if (haveTracker && haveLocationProvider(getEnabledLocationProviders(), LocationManager.GPS_PROVIDER)) { getTracker().stopTracking(false); } - triggerMenuInvalidation(); + mapLayout.post(() -> triggerMenuInvalidation()); return true; case R.id.menu_gps_clear: if (haveTracker) { @@ -2746,7 +2749,6 @@ private void addGpxLayer() { } else { Log.e(DEBUG_TAG, "addGpxLayer tracker not available"); } - triggerMenuInvalidation(); } /**