The work of the fragment manager

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?

+4
source share
1 answer

onDestroy . Activity, Fragment.

:

: "ondestroy" "ondestroyview" ?

onDestroy(), ?

0

Source: https://habr.com/ru/post/1622202/


All Articles