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
I have decided to override onCreateView and encapsulate the map in the code.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup viewGroup, Bundle bundle) {
View mapView = super.onCreateView(inflater, viewGroup, bundle);
RelativeLayout view = new RelativeLayout(getActivity());
view.addView(mapView, new RelativeLayout.LayoutParams(-1, -1));
// working with view
return view;
}
And it works as I needed.