What is the content_main.xml file for?

Asked

Viewed 1,334 times

0

I’m starting to study Android, using the tool Android Studio and I have a problem: as much as I search books or video lessons never find one that is updated.

I am with version 1.5.1, and in the creation of a project are created two XML files in the layout folder, a so-called content_main.xml and another call activity_main.xml

In the places where I see it does not show the creation of the archive content_main.xml. What is it for? Why has there been this change?

  • If you like books, understand English and have financial conditions for such, the The Busy Coder’s Guide to Android Development It is a good resource to always be updated.

  • Very expensive.. Suggests some site where I can get things updated and for free or some book in account?

  • Always stay tuned to the official website of Android developers. Go by parts: learn what existed until Android 2.3 (Activity, Service, Broadcastreceiver, Notification), then get a good look at Support Library v4 and Appcompat v7 and Fragments. After that, go to Material Design, then to Android 6.0 permissions. From there, always stay connected in the new releases of Android and Support Library by the same Android site. The problem is that you arrived late-- the system evolves fast. But big news comes out once a year. You can follow.

  • This content.xml issue is something new from API 23-- thing. I won’t risk an answer because I haven’t touched it yet, but the question is that it is now recommended to separate visual elements (buttons, text fields) from structural elements (sliders, tabs). The visual elements must go in content_main.xml and the others go in activity_main.xml .

1 answer

0


content_main refers to the content of your Activity,is where you will edit the body of your Activity(put buttons,Switchs,etc),and Activity_main is the layout itself,is where you edit the widget and background(background) of your Activity

Note:I can’t say that I’m an expert on the subject(actually I’m very Noob),more if you’re going to work with it,follow the updates and always read the functions and packages of android that you can ultilizar on their site http://developer.android.com/intl/pt-br/reference/packages.html

There’s everything you need practically to handle your app(as I said I’m not an expert), plus if you’re getting is a good one

Browser other questions tagged

You are not signed in. Login or sign up in order to post.