Fix context menu npe
This commit is contained in:
parent
7277f72b7a
commit
0294dd8c45
1 changed files with 12 additions and 10 deletions
|
@ -574,7 +574,7 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void restoreCustomMapRatio() {
|
private void restoreCustomMapRatio() {
|
||||||
if (map.hasCustomMapRatio()) {
|
if (map != null && map.hasCustomMapRatio()) {
|
||||||
map.restoreMapRatio();
|
map.restoreMapRatio();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -881,16 +881,18 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
|
||||||
public void onPause() {
|
public void onPause() {
|
||||||
restoreCustomMapRatio();
|
restoreCustomMapRatio();
|
||||||
|
|
||||||
ViewParent parent = view.getParent();
|
if (view != null) {
|
||||||
if (parent != null && containerLayoutListener != null) {
|
ViewParent parent = view.getParent();
|
||||||
((View) parent).removeOnLayoutChangeListener(containerLayoutListener);
|
if (parent != null && containerLayoutListener != null) {
|
||||||
|
((View) parent).removeOnLayoutChangeListener(containerLayoutListener);
|
||||||
|
}
|
||||||
|
getMapActivity().getMapViewTrackingUtilities().setContextMenu(null);
|
||||||
|
getMapActivity().getMapViewTrackingUtilities().setMapLinkedToLocation(false);
|
||||||
|
if (!wasDrawerDisabled) {
|
||||||
|
getMapActivity().enableDrawer();
|
||||||
|
}
|
||||||
|
menu.updateControlsVisibility(false);
|
||||||
}
|
}
|
||||||
getMapActivity().getMapViewTrackingUtilities().setContextMenu(null);
|
|
||||||
getMapActivity().getMapViewTrackingUtilities().setMapLinkedToLocation(false);
|
|
||||||
if (!wasDrawerDisabled) {
|
|
||||||
getMapActivity().enableDrawer();
|
|
||||||
}
|
|
||||||
menu.updateControlsVisibility(false);
|
|
||||||
super.onPause();
|
super.onPause();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue