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" ...
Get Android Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.
O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.