Philip Dukhov
02/06/2023, 2:53 PMActivityScoped
, when activity is destroyed - in this particular case I could've get an activity with ActivityContext
and listen to the lifecycle, but this won't work generally, e.g. with ActivityRetainedScoped
.
The only idea that come to my mind is using finalize
but it seems to be a bad practice and doesn't seems to be reliable - as I understand there's no guarantee it'll be called on time.
Usually Closeable
is used in such situations, I've tried implementing it but Dagger doesn't seems to be checking it.FunkyMuse
02/07/2023, 9:04 AMActivityRetainedLifecycle
which has onCleared
callbackPhilip Dukhov
02/07/2023, 2:07 PMActivityContext
- I need to cast context to activity and listen the lifecycle, right?FunkyMuse
02/07/2023, 2:09 PMPhilip Dukhov
02/07/2023, 4:07 PMFunkyMuse
02/07/2023, 8:13 PM