Elyes
03/10/2020, 3:17 PMonDestory
function of a fragment wouldn’t be called when closing the app ?Sean Keane
03/10/2020, 3:19 PMElyes
03/10/2020, 3:21 PMSean Keane
03/10/2020, 3:21 PMElyes
03/10/2020, 3:22 PMElyes
03/10/2020, 3:24 PMKris Wong
03/10/2020, 3:26 PMElyes
03/10/2020, 3:30 PMSean Keane
03/10/2020, 3:32 PMonDestroy()
is not guaranteed to be called unless you explicitly call onFinish()
.satyan
03/10/2020, 3:33 PMsetRetainInstance(true)
, onDestroy
won’t be called 🙂satyan
03/10/2020, 3:35 PMonDestroy
is linked to its Activity’s onDestroy
so the link from @Kris Wong is relevant:
There are situations where the system will simply kill the activity’s hosting process without calling this method (or any others) in it, so it should not be used to do things that are intended to remain around after the process goes away.
Elyes
03/10/2020, 3:37 PM