Android Fragment (with Compatibility Package on 2.3.3) creates “Specified child already has a parent error”

Can you post the content of your onCreateView(...) method in the NewsList Fragment?

I’m guessing that you are calling LayoutInflater.inflate(...) at some point. If so you need to use the overloaded version and pass attachToRoot as false as the View will be added to the hierachy in the Fragment.replace(...) call, so should not be attached during inflation.

Leave a Comment