Android Fragment no view found for ID?

前端 未结 30 1953
逝去的感伤
逝去的感伤 2020-11-22 05:33

I have a fragment I am trying to add into a view.

FragmentManager fragMgr=getSupportFragmentManager();
feed_parser_activity content = (feed_parser_activity)f         


        
30条回答
  •  既然无缘
    2020-11-22 05:54

    Just in case someone's made the same stupid mistake I did; check that you're not overwriting the activity content somewhere (i.e. look for additional calls to setContentView)

    In my case, due to careless copy and pasting, I used DataBindingUtil.setContentView in my fragment, instead of DataBindingUtil.inflate, which messed up the state of the activity.

提交回复
热议问题