[android] - handle destroying activity programmatically as part of theme switching (#10589)

This commit is contained in:
Tobrun
2017-11-30 11:45:40 +01:00
parent 8ad3759b9c
commit bc27322853

View File

@@ -416,8 +416,12 @@ public class MapView extends FrameLayout {
public void onDestroy() {
destroyed = true;
mapCallback.clearOnMapReadyCallbacks();
nativeMapView.destroy();
nativeMapView = null;
if (nativeMapView != null) {
// null when destroying an activity programmatically mapbox-navigation-android/issues/503
nativeMapView.destroy();
nativeMapView = null;
}
if (mapRenderer != null) {
mapRenderer.onDestroy();