Suppose that I have added three fragments:
A, Band Cin a transaction, and I'm doing the same thing. After committing the commands onResume()for A, Band Care called sequentially.
Next, I use the replace function to replace it with a new instance of the second fragment.
What I observed:
FragmentAdestroyed
FragmentCdestroyed
FragmentBcauses onStop(), notonDestroy()
A new instance is created FragmentBand its method is onCreate()called.
My question is: why onDestroy()to FragmentBnot called?
Ayush source
share