Fragments – The specified child already has a parent. You must call removeView() on the child’s parent first

Try to replace

View v = inflater.inflate(R.layout.camera_fragment, parent);

With

View v = inflater.inflate(R.layout.camera_fragment, parent, false);

or

View v = inflater.inflate(R.layout.camera_fragment, null);

Leave a Comment