diff --git a/OsmAnd/res/layout/fragment_coordinate_input_dialog.xml b/OsmAnd/res/layout/fragment_coordinate_input_dialog.xml index 03c2881bd3..bb53612811 100644 --- a/OsmAnd/res/layout/fragment_coordinate_input_dialog.xml +++ b/OsmAnd/res/layout/fragment_coordinate_input_dialog.xml @@ -152,20 +152,13 @@ - - - - - + android:layout_height="match_parent"/> diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java index 633fd04c51..649eae6ba1 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java @@ -222,13 +222,15 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm RecyclerView recyclerView = (RecyclerView) mainView.findViewById(R.id.markers_recycler_view); recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); adapter = new CoordinateInputAdapter(mapActivity, mapMarkers); - adapter.registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() { - @Override - public void onChanged() { - super.onChanged(); - mapMarkersLayout.setVisibility(adapter.isEmpty() ? View.GONE : View.VISIBLE); - } - }); + if (mapMarkersLayout != null) { + adapter.registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() { + @Override + public void onChanged() { + super.onChanged(); + mapMarkersLayout.setVisibility(adapter.isEmpty() ? View.GONE : View.VISIBLE); + } + }); + } recyclerView.setAdapter(adapter); recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override