1

In an updated version of android studio, it create 2 files automatically, I read about these files , but am still confused, as both work similarly, So how to decide which one should I use to put the things and code, what are the things I should put in these 2 files ?

pRaNaY
  • 24,642
  • 24
  • 96
  • 146
ash...
  • 27
  • 2
  • also where should i put my stuffs such as button, textview, all these things for my app.. – ash... Jan 26 '17 at 16:59
  • 1
    Please do some basic research before posting questions. http://stackoverflow.com/questions/32880722/what-is-the-role-of-content-main-xml-in-android-studio-1-4 http://stackoverflow.com/questions/33183107/difference-between-content-main-xml-and-activity-main-xml http://stackoverflow.com/questions/33414034/why-is-there-content-main-xml-and-activity-main-xml-by-default-instead-of-just-a http://stackoverflow.com/questions/33190072/content-main-xml-vs-activity-main-xml http://stackoverflow.com/questions/41331119/what-to-use-activity-main-or-content-main http://stackoverflow.com/questions/34684318/ – Mike M. Jan 26 '17 at 23:43

1 Answers1

4

This is just a cool concept , where by content_main.xml layout is just included inside the activity_main.xml. So you have to put your stuff in content_main.xml.

The essence of using activity_main.xml is to insert other widgets such as (Floating Action Bar ) on top of a content_main.xml layout.

There for basically , this approach just teaches us on how to include an xml file into the others , instead of congesting several components in one xml file.

All in all, you just edit your content_main.xml layout

Lutaaya Huzaifah Idris
  • 3,596
  • 8
  • 38
  • 77