findViewById returns null on a LinearLayout inside an d view

前端 未结 2 813
日久生厌
日久生厌 2020-12-03 22:07

I cannot figure out mistake here. I may be oevrlooking some thing...

Layout XML:



        
2条回答
  •  一个人的身影
    2020-12-03 22:43

    If you set the id attribute for the include element, then that will be the id for the root of the inflated layout. So, instead of looking for a LinearLayout with the id headerLayout look for the id headerInclude(or don't set an id for the include element).

提交回复
热议问题