Sudhir Singh Khanger
06/01/2021, 1:28 PMrunBlocking { //room db call }
in onDestroy()
of an Activity
to execute a task which must happen when the Activity
is killed? I could use a lifecycleScope
which wraps both the db call and super.onDestroy()
but I was wondering if that might cause any adverse effects.mbonnin
06/01/2021, 5:47 PMErik
06/01/2021, 6:53 PMephemient
06/01/2021, 7:27 PMmbonnin
06/01/2021, 7:29 PMErik
06/01/2021, 7:33 PMViewModel#onCleared
ephemient
06/01/2021, 7:33 PMErik
06/01/2021, 7:35 PMephemient
06/01/2021, 7:36 PMErik
06/01/2021, 7:38 PMNote: do not count on this method being called as a place for saving data!https://developer.android.com/reference/android/app/Activity#onDestroy()
ephemient
06/01/2021, 7:41 PMErik
06/01/2021, 7:42 PMonStop
or to the view model more often than using a process lifecycle ownerephemient
06/01/2021, 7:50 PMErik
06/01/2021, 7:52 PM