diff options
author | Łukasz Paczos <lukas.paczos@gmail.com> | 2018-12-11 17:49:01 +0100 |
---|---|---|
committer | Łukasz Paczos <lukasz.paczos@mapbox.com> | 2018-12-14 10:26:43 +0100 |
commit | c2a4a8822ce9577c972975da61034a30fb0fe3e9 (patch) | |
tree | f438272760d8252d4edc714bb2a3cb52687353ff | |
parent | 9064c8e4a1349eea0a7a0e1d63bb53b425709635 (diff) | |
download | qtlocation-mapboxgl-c2a4a8822ce9577c972975da61034a30fb0fe3e9.tar.gz |
[android] properly stop renderer when dismissing an example dialog
-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(); |