What is the difference between Acitvity_Main.xml and Fragment_main.xml files in Android Studio

后端 未结 3 1402
醉梦人生
醉梦人生 2020-12-14 16:20

When ever i create a new project, the Fragment_main.xml file is added to my Layout folder and unlike in Eclipse it is this file that contains what is normally in the Activit

3条回答
  •  半阙折子戏
    2020-12-14 16:58

    If you are creating a new Project and it adds fragment_main.xml by default you must be selecting a layout by default. Maybe a pager/spinner layout?

    Fragment_main is the same as activity_main. The names are just string labels and mean nothing in and of itself and are just changed for clarity by the IDE.

    Have a read of this.

    http://developer.android.com/guide/topics/ui/declaring-layout.html

提交回复
热议问题