From the course: Android Development Essential Training: Your First App with Kotlin

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Implement designs in XML layouts

Implement designs in XML layouts - Android Tutorial

From the course: Android Development Essential Training: Your First App with Kotlin

Start my 1-month free trial

Implement designs in XML layouts

- [Instructor] When an activity first comes to the screen it loads it in XML layout file by calling the set content view function. The set content view function takes an integer value that's the resource ID of this file. This expression R.layout.activity.main references an integer value that's assigned automatically. And stored in a class named R. Now that class is auto-generated and you'll never make changes to it yourself. If you did find the class and change it, your changes would be wiped out automatically by a process that's running in the background as you code that's generating that class. The resource ID for a layout file always starts with R.layout. Layout references the layout directory in the resources directory and then ends with the name of the file without the file extension. Now you can jump to that file by pressing control or command and clicking the ID. And that'll take you to activitymain.xml. Over here in the project window, you can collapse all these directories…

Contents