Это видимо баг фреймворка. Я сейчас пытаюсь удалить view так:
@Overridepublic View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_layout_help, container,
false);
//MyView это костомное view.
text_help_link = (MyView) view.findViewById(R.id.MyViewHelp3);
text_help1 = (MyView) view.findViewById(R.id.MyViewHelp2);
text_help2 = (MyView) view.findViewById(R.id.MyViewHelp4);
text_help3 = (MyView) view.findViewById(R.id.MyViewHelp5);
text_help4 = (MyView) view.findViewById(R.id.MyViewHelp6);
text_help5 = (MyView) view.findViewById(R.id.MyViewHelp10);
text_help = (MyView) view.findViewById(R.id.MyViewHelp1);
text_help.setTypeface(FontsHelper.getTypeFace(getActivity()
.getApplicationContext(), FONT_PATH1));
if(BuildConfig.isPaid) {
container.removeView(text_help4);
container.removeView(view.findViewById(R.id.button_help2));
}
return view;
}