■ CONTENTS
xvi
Preparing Your Application Icon ................................................................................................................... 1004
Considerations for Making Money From Apps ............................................................................................. 1004
Directing Users Back to the Market ............................................................................................................. 1005
The Android Licensing Service .................................................................................................................... 1006
Preparing Your .apk File for Uploading ........................................................................................................ 1007
Uploading Your Application ............................................................................................................................... 1007
User Experience on Android Market ................................................................................................................. 1010
Beyond Android Market .................................................................................................................................... 1012
References ........................................................................................................................................................ 1013
Summary .......................................................................................................................................................... 1013
Chapter 29: Fragments for Tablets and More ............................................ 1015
What is a Fragment? ......................................................................................................................................... 1015
When to Use Fragments ............................................................................................................................... 1016
The Structure of a Fragment ........................................................................................................................ 1017
A Fragment’s Lifecycle ................................................................................................................................ 1018
Sample Fragment App Showing the Lifecycle ............................................................................................. 1024
FragmentTransactions and the Fragment Back Stack ...................................................................................... 1032
Fragment Transaction Transitions and Animations ..................................................................................... 1034
The FragmentManager ...................................................................................................................................... 1035
Caution When Referencing Fragments ........................................................................................................ 1037
ListFragments and <fragment> .................................................................................................................. 1037
Invoking a Separate Activity When Needed ................................................................................................. 1041
Persistence of Fragments ............................................................................................................................ 1044
Understanding Dialog Fragments ..................................................................................................................... 1044
DialogFragment Basics ................................................................................................................................ 1045
DialogFragment Sample Application ............................................................................................................ 1050
More Communications with Fragments ............................................................................................................ 1063
Using startActivity() and setTargetFragment() ............................................................................................. 1064
Custom Animations with ObjectAnimator ......................................................................................................... 1064
References ........................................................................................................................................................ 1067
Summary .......................................................................................................................................................... 1068
Chapter 30: Exploring ActionBar ............................................................... 1069
Anatomy of an ActionBar .................................................................................................................................. 1070
Tabbed Navigation Action Bar Activity .............................................................................................................. 1071
Implementing Base Activity Classes ............................................................................................................ 1073
Assigning Uniform Behavior for the ActionBar ............................................................................................. 1075
Implementing the Tabbed Listener .............................................................................................................. 1077
Implementing the Tabbed Action Bar Activity .............................................................................................. 1078
Scrollable Debug Text View Layout .............................................................................................................. 1080
Action Bar and Menu Interaction ................................................................................................................. 1081
Android Manifest File ................................................................................................................................... 1083
Examining the Tabbed Action Bar Activity ................................................................................................... 1084
List Navigation Action Bar Activity .................................................................................................................... 1084
Creating a SpinnerAdapter ........................................................................................................................... 1085
Creating a List Listener ................................................................................................................................ 1086
Setting Up a List Action Bar ......................................................................................................................... 1086
Making Changes to BaseActionBarActivity .................................................................................................. 1087
Making Changes to AndroidManifest.xml .................................................................................................... 1087
Examining the List Action Bar Activity ......................................................................................................... 1088
Standard Navigation Action Bar Activity ........................................................................................................... 1090
Standard Navigation Action Bar Activity ...................................................................................................... 1090
Making Changes to BaseActionBarActivity .................................................................................................. 1091