Networking Across Configuration Changes
Now that you have your app deserializing JSON into model objects, take a closer look at how your implementation behaves across a configuration change. Run your app, make sure auto-rotate is turned on for your device or emulator, and then rotate the device quickly five or so times in a row. Inspect the Logcat output, filtering by PhotoGalleryFragment and turning soft wraps off.
15:49:07.304 D/PhotoGalleryFragment: Response received: [GalleryItem(... 15:49:16.794 D/PhotoGalleryFragment: Response received: [GalleryItem(... 15:49:20.098 D/PhotoGalleryFragment: Response received: [GalleryItem(... 15:49:23.565 D/PhotoGalleryFragment: Response received: [GalleryItem(... 15:49:27.043 D/PhotoGalleryFragment: ...
Get Android Programming: The Big Nerd Ranch Guide, 5th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.