

OnDestroyView: This method is called before OnDestroy, it is used when you need to clean fragment view objects before destroy.When removing the current fragment or replace the current fragment with another fragment. OnStop: This fragment is going to be stopped.Such as when removing the current fragment or replace the current fragment with another fragment. OnPause: This method is called when the fragment will be left.



When an activity adds a fragment to it, it will get a reference of the fragment’s view.FragmentTransaction‘s remove(), replace() method can also make a fragment runs into the destroy state when you do not call the addToBackStack() method to add the fragment to the back stack. Destroy State: When an activity is destroyed, it’s child fragment is destroyed also.A stopped fragment is invisible, it can be recycled by the android OS. FragmentTransaction‘s remove(), replace() method can also make a fragment runs into the stop state. Stop State: When an activity is stopped, its related fragments are stopped also.This activity-related fragment is paused also. Pause State: If an activity is paused because another not-full-screen activity is displayed at the top of the back stack.Running State: Fragment is visible, its belonged activity is running.
