in all documents and articles says don't need to set null for class field of activity or fragment when destroyed because GC cleared them automatically for release memory, but this examples google use a simple helper (AutoClearedValue) for release memory of DataBinding and adapter fields for fragment, i want to know it is necessary ?
I want to know too.BasicSample don't used AutoClearedValue
@JakeWoki it is only exist in github example
@DJafari @JakeWoki Look at this workflow, you have Activity and Fragment A and then you add another Fragment B with replace using addToBackStack() metod when you are doing transaction to replace Fragment A. For Fragment A method onFragmentViewDestroyed will be called because it's not visible anymore but it will not be destroyed.
Thanks, @goransipic
I wondered for a while why!
Most helpful comment
@DJafari @JakeWoki Look at this workflow, you have Activity and Fragment A and then you add another Fragment B with replace using addToBackStack() metod when you are doing transaction to replace Fragment A. For Fragment A method onFragmentViewDestroyed will be called because it's not visible anymore but it will not be destroyed.