Laying Out the User Interface
By default, Eclipse opened activity_quiz.xml in Android’s graphical layout tool, which shows you a preview of the layout. The graphical layout tool can be useful, but for now you are going to work in XML to get a better understanding of how layouts work.
To get to the raw XML, select the tab at the bottom of the editor labeled activity_quiz.xml.
Currently, activity_quiz.xml defines the default activity layout. The defaults change frequently, but the XML will look something like Listing 1.1.
Listing 1.1 Default activity layout (activity_quiz.xml
)
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" ...
Get Android Programming: The Big Nerd Ranch Guide 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.