diff options
-rw-r--r-- | platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/MapInDialogActivity.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/MapInDialogActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/MapInDialogActivity.java index 56104e801b..509b223d5f 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/MapInDialogActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/MapInDialogActivity.java @@ -69,13 +69,12 @@ public class MapInDialogActivity extends AppCompatActivity { @Override public Dialog onCreateDialog(Bundle savedInstanceState) { return new Dialog(getActivity(), getTheme()) { - boolean destroyed = false; - @Override public void dismiss() { - if (mapView != null && !destroyed) { + if (mapView != null && !mapView.isDestroyed()) { + mapView.onPause(); + mapView.onStop(); mapView.onDestroy(); - destroyed = true; } super.dismiss(); } @@ -107,6 +106,12 @@ public class MapInDialogActivity extends AppCompatActivity { } @Override + public void onDestroyView() { + super.onDestroyView(); + mapView.onDestroy(); + } + + @Override public void onLowMemory() { super.onLowMemory(); mapView.onLowMemory(); |