Android Fragment no view found for ID?

前端 未结 30 2303
逝去的感伤
逝去的感伤 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 06:16

    I had this problem (when building my UI in code) and it was caused by my ViewPager (that showed Fragments) not having an ID set, so I simply used pager.setID(id) and then it worked.

    This page helped me figure that out.

提交回复
热议问题