An XML layout file determines how your screen looks when first presented to the user. Learn how to create and edit layout files and how they're loaded when an activity comes to the screen.
- [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…and then jump to the location of the file…
- Installing Android Studio
- Creating your first Android Studio project
- Managing configuration files, including Gradle scripts
- Defining screens with activities
- Implementing designs in XML layouts
Skill Level Beginner
Android P First Look for Developerswith David Gassner36m 30s Beginner
Android Studio Essential Trainingwith David Gassner2h 28m Beginner
What you should know2m 10s
1. Android Development Fundamentals
2. Getting Started
3. Explore Android Projects
4. Android App Architecture
Next steps1m 10s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.