aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsudev <rasch@munin-soft.de>2015-01-18 22:45:34 +0100
committerrsudev <rasch@munin-soft.de>2015-01-18 22:45:34 +0100
commitb71a6038747d7c164b8ed5eb9dab184ac6e13c8d (patch)
treec49c3f1749a392ae1d0e09b277d8500704c8e7b0
parent2908ba721fcc297b6947cf3f4c758d536ad1034b (diff)
parent4dab903b443f4985c4af207faf97de563304fdd6 (diff)
downloadcgeo-b71a6038747d7c164b8ed5eb9dab184ac6e13c8d.zip
cgeo-b71a6038747d7c164b8ed5eb9dab184ac6e13c8d.tar.gz
cgeo-b71a6038747d7c164b8ed5eb9dab184ac6e13c8d.tar.bz2
Merge remote-tracking branch 'upstream/issue-2687' into release
-rw-r--r--main/src/cgeo/geocaching/maps/CGeoMap.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/main/src/cgeo/geocaching/maps/CGeoMap.java b/main/src/cgeo/geocaching/maps/CGeoMap.java
index 18826a4..457b06c 100644
--- a/main/src/cgeo/geocaching/maps/CGeoMap.java
+++ b/main/src/cgeo/geocaching/maps/CGeoMap.java
@@ -876,7 +876,12 @@ public class CGeoMap extends AbstractMap implements ViewFactory {
if (restartRequired) {
mapRestart();
} else if (mapView != null) { // changeMapSource can be called by onCreate()
+ mapStateIntent = currentMapState();
mapView.setMapSource();
+ // re-center the map
+ centered = false;
+ centerMap(geocodeIntent, searchIntent, coordsIntent, mapStateIntent);
+ // re-build menues
ActivityMixin.invalidateOptionsMenu(activity);
}
@@ -887,9 +892,6 @@ public class CGeoMap extends AbstractMap implements ViewFactory {
* Restart the current activity with the default map source.
*/
private void mapRestart() {
- // close old mapview
- activity.finish();
-
// prepare information to restart a similar view
final Intent mapIntent = new Intent(activity, Settings.getMapProvider().getMapClass());
@@ -908,6 +910,9 @@ public class CGeoMap extends AbstractMap implements ViewFactory {
mapIntent.putExtra(Intents.EXTRA_MAPSTATE, mapState);
}
+ // close old map
+ activity.finish();
+
// start the new map
activity.startActivity(mapIntent);
}