What is setContentView(R.layout.main)?

后端 未结 6 1297
滥情空心
滥情空心 2020-11-29 08:07

I understand that it has to do with the App layout, but when do I have to use it? I tried to look for a link that explained this method, but I couldn\'t find it. Thank you i

6条回答
  •  遥遥无期
    2020-11-29 08:35

    Why setContentView() in Android Had Been So Popular Till Now?

    setContentView(int layoutid) - method of activity class. It shows layout on screen.

    R.layout.main - is an integer number implemented in nested layout class of R.java class file.

    At the run time device will pick up their layout based on the id given in setcontentview() method.

提交回复
热议问题