I have recently updated android studio to 1.4 and noticed that there is now a content_main.xml and an activity_main.xml. It seems that content_main deals with what goes into the app and activity_main deals with the layout/display of the widgets from content_main, I am not sure whether this is correct? Also would it be possible for anyone to explain why having activity_main deal with just the layout is better and why Google decided to do this split?
All help is much appreciated.
I'll explain what they are for:
activity_main.xml:
this xml file is used to display coordinatorLayout,tabLayout,floatingActionButton,viewPager etc. etc.
content_main.xml:
This xml file is use to display your stuff i.e. what you want to display to users.
So, if you are just asking in which xml you have to put your stuff, content_main.xml is the one
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With