Android Programming The Big Nerd Ranch Guide, 3rd Edition

(Brent) #1
Rotation and retained fragments

415

Figure 21.9  Default rotation with a UI fragment


On the other hand, if retainInstance is true, then the fragment’s view is destroyed but the fragment
itself is not. When the new activity is created, the new FragmentManager finds the retained fragment
and re-creates its view (Figure 21.10).


Figure 21.10  Rotation with a retained UI fragment


http://www.ebook3000.com

Free download pdf