ursus
12/28/2021, 1:53 AMDominaezzz
12/28/2021, 2:28 AMGlobalScope
.Nick Allen
12/28/2021, 3:02 AMursus
12/28/2021, 4:21 AMNick Allen
12/28/2021, 4:51 AMCoroutineScope
, or creating/cancelling based on `onAttachedToRecyclerView`/`onDetachedFromRecyclerView`. If it's just to be lazy ... then sure, it'll GC (you can use profiler to be certain). And if you never cancel, then you might as well use GlobalScope
(It'll make it clearer that you aren't cancelling).louiscad
12/28/2021, 10:40 AMstojan
12/29/2021, 9:50 AMCool then it should be fine. Im trying to add diffing to android recyclerview adapter, via coroutines as impl. detaild and it needs a scope, but Adapter had no lifecyclethe adapter should use the lifecycle of the Activity/Fragment that contains it.... you can pass the lifecycle/scope in the constructor you also might wanna check
ListAdapter
that already does the diffing on a background thread