Error inflating class fragment

后端 未结 30 2235
长发绾君心
长发绾君心 2020-11-22 14:38

I get the Error

Unable to start activity ComponentInfo{de.androidbuch.activiti/de.androidbuch.activiti.task.Activity}: android.view.InflateException: Binar         


        
30条回答
  •  粉色の甜心
    2020-11-22 14:57

    Fragments cannot be nested in XML

    Learnt this the hard way - if you nest an XML layout based tag inside a (potentially) dynamically loaded fragment from FragmentManager, then you start to get weird errors, trying to inflate your fragment xml.

    Turns out, that this is not supported - it will work fine if you do this through purely the FragmentManager approach.

    I was getting this problem because I was trying load a fragment inside a from xml, and this was causing a crash in the onCreateView() method when I popped the back stack.

提交回复
热议问题