crash fixes

This commit is contained in:
madwasp79 2019-06-25 15:07:41 +03:00
parent 558ef08a6a
commit 5caf6c48ed
2 changed files with 9 additions and 1 deletions

View file

@ -203,8 +203,12 @@ public class PointDescription {
results.put(PointDescription.formatToHumanString(ctx, f),
ctx.getString(sh ? R.string.short_location_on_map : R.string.location_on_map, 0, 0));
}
int zoom = 17;
if (ctx.getMapView() != null) {
zoom = ctx.getMapView().getZoom();
}
final String httpUrl = "https://osmand.net/go?lat=" + (lat)
+ "&lon=" + (lon) + "&z=" + ctx.getMapView().getZoom();
+ "&lon=" + (lon) + "&z=" + zoom;
results.put("URL", httpUrl);
return results;
}

View file

@ -637,6 +637,10 @@ public class MenuBuilder {
collapsableView.getContenView().setVisibility(View.GONE);
iconViewCollapse.setImageDrawable(getCollapseIcon(true));
}
if (collapsableView.getContenView().getParent() != null) {
((ViewGroup) collapsableView.getContenView().getParent())
.removeView(collapsableView.getContenView());
}
baseView.addView(collapsableView.getContenView());
}