July 2015
Beginner to intermediate
600 pages
18h 59m
English
The steps to creating a UI fragment are the same as those you followed to create an activity:
compose a user interface by defining widgets in a layout file
create the class and set its view to be the layout that you defined
wire up the widgets inflated from the layout in code
CrimeFragment’s view will display the information contained within an instance of Crime. Eventually, the Crime class and CrimeFragment’s view will include many interesting pieces, but for this chapter you just need a text field to contain the crime’s title.
Figure 7.15 shows the layout for CrimeFragment’s view. It consists of a vertical LinearLayout that contains an EditText. EditText ...
Read now
Unlock full access