This chapter discusses the relationship of the life cycle of fragments with that of activities and demonstrates the appropriate programming actions at various points in the life cycle. The special purpose fragment classes, ListFragment
and DialogFragment
, are introduced covering their use and how their behavior in the activity life cycle differs from that of standard fragments.
The following topics are covered in this chapter:
Fragment setup/display event sequence
Fragment teardown/hide event sequence
Working with the
ListFragment
classWorking with the
DialogFragment
classInteracting with a
DialogFragment
class as a traditionalDialog
classWrapping an existing
Dialog
class in aDialogFragment
class
By the end of this chapter, we will be able to coordinate the setup and teardown of fragments within their host activities and effectively utilize the ListFragment
and DialogFragment
classes.