Difference between content_main.xml and activity_main.xml?

前端 未结 6 1485
盖世英雄少女心
盖世英雄少女心 2020-11-28 08:16

I am new to Android App development. I have Android Studio 1.4. In my layout folder I have two XML files (content_main.xml and activity_main.xml).

6条回答
  •  伪装坚强ぢ
    2020-11-28 08:53

    These are just 2 xml layout files which basically represent 2 different layouts. You should use the file based on the layout you want to use in your android app.

    Based on the tutorial it is simple that you should use activity_main.xml as it is the layout for the MainActivity.

    You can also see the preview of the layout file in android studio as to how it will look in the app.

提交回复
热议问题