findViewById() returns null for custom component in layout XML, not for other components

前端 未结 18 1528
情歌与酒
情歌与酒 2020-11-28 10:36

I have a res/layout/main.xml including these elements and others:



        
18条回答
  •  囚心锁ツ
    2020-11-28 11:28

    Be sure that the setContentView(R.layout.main) statement call before findViewById(...) statement;

提交回复
热议问题