I'm having this issue with my fragment only in API 31. In the host Activity
I use replace
to add my fragment:
transaction.replace(container, fragment, tag);
Everything runs as expected. But when I send the app in background in API 31 the fragment's lifecycle doesn't evolve as I was thinking. It doesn't call onDestroy
. It only goes till onStop
. Meanwhile, in previous versions of Android the fragment gets completely destroyed when I send the app to background.
Anyone else experiencing this problem?