When a fragment is being created, it goes through the following states:
When the fragment becomes visible, it goes through these states:
When the fragment goes into the background mode, it goes through these states:
When the fragment is destroyed (when the hosting activity is destroyed), it goes through the following states:
You can restore an instance of a fragment using a Bundle object, in the following states:
We can save a fragment's state in the onSaveInstanceState()
method.
Most of the states experienced by a fragment are similar to those of activities. A few new states are specific to fragments: