Laying Out the UI

Click the tab for the layout file, activity_main.xml. This will open the layout editor in the editor tool window (Figure 1.9). If you do not see a tab for activity_main.xml, do not worry. Expand app/res/layout/ in the project tool window. Double-click activity_main.xml to open the file. If activity_main.xml opens but shows XML instead of the layout editor, click the Design tab at the bottom of the editor tool window.

Figure 1.9  Layout editor

Layout editor

By convention, a layout file is named based on the activity it is associated with: Its name begins with activity_, and the rest of the activity name follows in all ...

Get Android Programming: The Big Nerd Ranch Guide, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.