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);
Android fragments - The specified child already has a parent. You must call removeView() on the child's parent first
I'll take a shot and suggest you get the error because you return mDrawerListView
in onCreateView()
instead of group
. The returned from onCreateView()
view is itself attached to another view hierarchy, which is impossible in this case because from the XML layout it already has a parent ViewGroup
.
I can see nothing preventing from returning group
in onCreateView()
.
Android Fragment API 26 The specified child already has a parent. You must call removeView() on the child's parent first.
So it appears it has something to do with
transaction.setCustomAnimations(R.anim.enter_from_right, R.anim.exit_to_left);
Related Topics
Android Studio 4.1 Plugin Error: Plugin * Is Incompatible (Supported Only in Intellij Idea)
Android: Custom Separator (Or Even Item) in Listview Depening on Content of Item
How to Copy Selected Files from Android with Adb Pull
Having Issue on Real Device Using Vector Image in Android. Svg-Android
How to Show/Hide Password in Textformfield
Android Cardview Remove Padding
Searchview Getactionview Returning Null
Gesture Detection and Scrollview Issue
Push Up Content When Clicking in Edit Text
Page Scroll When Soft Keyboard Popped Up
Setting Audio File as Ringtone
Rotate Zoom Drag Image in Android Imageview
How to Get the Battery Level After Connect to the Ble Device
Tablayout Tab Title Text in Lower Case