I have SupportMapFragment and I need to add custom controls into it for changing a map type. Calling getView(), I get NoSaveStateFramelayout and I don\'t think it is a good idea
Use this code to add you layout above of the map
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View mapView = super.onCreateView(inflater, container, savedInstanceState);
@SuppressLint("InflateParams")
FrameLayout view = (FrameLayout) inflater.inflate(R.layout.fragment_map, null);
view.addView(mapView, 0, new RelativeLayout.LayoutParams(-1, -1));
return view;
}