From f95a34f335af67b0949770a03405e663baa2a610 Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Sat, 20 Feb 2016 18:18:11 +0300 Subject: [PATCH] Fix https://github.com/osmandapp/Osmand/issues/2239 --- .../src/net/osmand/plus/activities/MapActivity.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index 9d153c1058..7f6d5f83f3 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -1037,8 +1037,17 @@ public class MapActivity extends AccessibleActivity implements DownloadEvents, } ((MapActivity) activity).readLocationToShow(); } else { - prevActivityIntent = new Intent(((Activity) activity).getIntent()); - prevActivityIntent.putExtra(INTENT_KEY_PARENT_MAP_ACTIVITY, true); + if (activity instanceof Activity) { + Intent intent = ((Activity) activity).getIntent(); + if (intent != null) { + prevActivityIntent = new Intent(intent); + prevActivityIntent.putExtra(INTENT_KEY_PARENT_MAP_ACTIVITY, true); + } else { + prevActivityIntent = null; + } + } else { + prevActivityIntent = null; + } Intent newIntent = new Intent(activity, ((OsmandApplication) activity.getApplicationContext()) .getAppCustomization().getMapActivity());