Android – why is there content by default_ Main.xml and activity_ Main.xml, not just activity_ main.xml?
I just started learning 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). I use online tutorials to learn, but they only have activity_ Main.xml. So I want to know what functions should be used in these corresponding files. I can only use activity_ Main.xml, let others? vice versa.
resolvent:
Modern Android method is based on fragments. To some extent, it is a "small activity". You can put it into the activity and get great flexibility
Therefore, activity_ Main.xml only contains the activity layout of the container (most likely FrameLayout), and content_ Main.xml is the layout of the fragment put into this container somewhere in mainactivity.java. You should learn the code there to better understand it:)