Handling Lifecycles with Lifecycle-Aware Components | Android Developers

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