O'Reilly logo

Android Programming: The Big Nerd Ranch Guide by Brian Hardy, Bill Phillips

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Updating the Layout

Here is what CrimeFragment’s view will look like by the end of this chapter.

Figure 8.1  CriminalIntent, episode 2

CriminalIntent, episode 2

To get this on screen, you are going to add four widgets to CrimeFragment’s layout: two TextView widgets, a Button, and a CheckBox.

Open fragment_crime.xml and make the changes shown in Listing 8.3. You may get errors from missing string resources that you will create in a moment.

Listing 8.3  Adding new widgets (fragment_crime.xml)

<​?​x​m​l​ ​v​e​r​s​i​o​n​=​"​1​.​0​"​ ​e​n​c​o​d​i​n​g​=​"​u​t​f​-​8​"​?​>​ <​L​i​n​e​a​r​L​a​y​o​u​t​ ​x​m​l​n​s​:​a​n​d​r​o​i​d​=​"​h​t​t​p​:​/​/​s​c​h​e​m​a​s​.​a​n​d​r​o​i​d​.​c​o​m​/​a​p​k​/​r​e​s​/​a​n​d​r​o​i​d​"​ ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required