I am using the androidx.navigation to navigate around the fragments.
I am seeing different behavior across different versions of FOS.
When i switch between the fragments onDestroy
public void onDestroy() {}
is not called for api 21 and 22 right away. It gets called only when i try to create the same fragment again.
For api > 24, same method is called right away.
Whats the different? why this behavior, I have to do some cleanup which i am doing in onDestroy. Should i use the onDestroyView instead ?