Hi, i am trying to use `coroutines` using ` 'andr...
# android
k
Hi, i am trying to use
coroutines
using
'androidx.lifecycle:lifecycle-extensions:2.2.0-alpha01'
which is latest version but i'm unable to get
Copy code
viewLifecycleOwner.lifecycleScope.launch {}//here lifecycleScope is not available
, what i'm missing ?
l
the right package for this is
androidx.lifecycle:lifecycle-runtime-ktx:2.2.0-alpha01
and for livedata builders
androidx.lifecycle:lifecycle-livedata-ktx:2.2.0-alpha01
k
so can i remove 'extensions' and just keep 'runtime' and what is diffrence between both packages?
l
extensions it’s the package for LiveData/ViewModel which they extend the lifecycle objects (LifecycleOwner/Observer)
it’s not about kotlin extension functions
the
-ktx
are the ones with kotlin related code extensions
maybe there’s a
extensions-ktx
which has both? I haven’t tried
k
ok thanks for helping 👍
👍 1
l
in any case you can read more here https://developer.android.com/kotlin/ktx
👍 3