-
Notifications
You must be signed in to change notification settings - Fork 156
java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first. #56
Comments
@tahaelsherif It's look like you already added the view in parent and that code called again after configuration changes. Please supporting the configuration changes in your app to solve this. If my answer is not related to your issue. Please provide more information about that view. |
How do I support the configuration changes in my app ? |
Please see https://developer.android.com/guide/topics/resources/runtime-changes This also happen when screen size changed (rotate device). To make sure that problem is about configuration changes, not the library. Please try to open that activity and rotate the device (without android:configChanges attribute in Activity). |
All activities are portrait only :) |
@tahaelsherif Does not about your app support landscape or not. Just only enable screen orientation for test about your issue. There's many situation for config changes but screen orientation is easy to test. |
Ok i will try to test as many usecases as i can and i will let you know. |
So finally it was not from your library the issue is caused by fragment inflating, the fragment was attached to the parent view. This is the old one And then I changed it to this one And then everything was fixed anyway thank you for your time maybe you should mention this as a tip for your documentation. |
@tahaelsherif I thought that |
Yes it's supposed to be false by default but I changed it to true once for some testing and i forgot to returing it to false before i added your librray , so i didn't know that this was cuasing the problem |
App crash when change language inside fragment
The text was updated successfully, but these errors were encountered: