Working with Fragments and keeping your sanity

04/29/2016 - 13:15 to 14:00
Stage A

Session abstract: 

At a first glance fragments may seem simple enough to use, however diving deeper reveals that fragments have a complex lifecycle (~ 12 lifecycle methods), and a lot of edge cases and pitfalls that need to be given special attention.
This talk will touch the following topics (but not limited to):
* What's the purpose of the different lifecycle methods and what should I do in each one of them?
* Where should I initialize the fragment state and where should I initialize view state?
* What happens to my fragment when the user navigate away from it?
* What happens to my fragment when a rotation occurs when it's visible and how is it different between what happens to it when it's in the backstack?
* How should I correctly perform async network calls from the fragment to ensure that upon rotation a second network call will not be made.
* Fragment to fragment communication.
* How to implement pass-through fragments?