What is the meaning of `Content_main.xml`?

As far as I understand, a file contentis just the contents of the files xml... but in a separate file. What's the point?

I have seen

What is the role of content_main.xml in android studio 1.4?

and there doesn't seem to be much documentation about content_XXX.xml, so I was wondering why the new update includes creating this file by default?

Why divide the code into two files, why not just put all the content in my own XML file, I tried it ... and it works. I do not understand why the file is created content_mainwhen creating a new project.

Can someone give me a list of benefits, why should I use a file content?

Thanks,

Ruchir

+4
source share
1 answer

activity_main.xml used to display coordinators: Layout, tabLayout, floatActionButton, viewPager, etc.

content_main.xml used to display your material, that is, what you want to display to users.

for more details check my answer here .

: , . . Android Studio , , , .

+2

Source: https://habr.com/ru/post/1623625/


All Articles