Handling lifecycles with lifecycle-aware components  |  Android Developers

Use the new Lifecycle classes to manage activity and fragment lifecycles.