Create your account

Already have an account? Login here

Create account

49. Fragment Lifecycle Demo

Design + Code an Android App from Scratch

Woah, wait a second..

Scrounge up some loose change to become a pro member, or login to your account to view this lesson.

Alright, join now. Or login to your account if you're already a pro member.

This video shows an example of Fragment lifecycle in Android by printing the different methods to Log-cat as they are called by the Android system. The example simply adds a Fragment to an Activity and tries doing several things such as starting the app, exiting from the app by minimising it, exiting from the app by pressing the back button, rotating the screen and so on. The methods onAttach, onCreate, onCreateView, onActivityCreated, onStart, onResume, onPause, onStop, onDestroyView, onDestroy, onDetach are called at different times depending on what the user is doing with the app.

Course Cirriculum