This is my code in adapter using recyclerView. How to improve this code to not use Main Scope, but to use scope that could be disposal? I need to have access to
Context In Jetpack compose, we have the option of using rememberCoroutineScope() as well as using the LaunchedEffect composable in order to use coroutines / run
I am trying to write tests for my Repository which provides access to my Room database. For this, I wrote a Mock Database and a mock DAO: My Database: abstract
I am using MutableStateFlow. My flow type is sealed class with different states (Loading, Success, Error, etc). Initial value of my flow is empty: private val _
When we have a coroutine scope, when it is canceled, can it be used again? e.g. for the below, when I have scope.cancel, the scope.launch no longer work @Te
I have a Room database that returns a Flow of objects. When I insert a new item into the database, the Flow's collect function only triggers if the insert was p
I use the KMongo tool How we can mock a Coroutine Database? How can we mock our database in a koin module? Is there a way to do this? Thanks for guiding me Meth
I need to use coroutines inside a custom view. After watching this talk, I believe my best option is to use lifecycleScope as the coroutine scope, so that it wi
I'm trying to query Room database(action 1) and then based on the returned results perform another action on the same table. however I noticed that every time I
I'm using Coroutines for dealing with async jobs: viewModelScope.launch { val userResponse = getUsers() //suspendable function } What I want to do is stop
How to provide scope or how to call suspend function from Service Android? Usually, activity or viewmodel provides us the scope, from where we can launch suspen
I have an issue regarding kotlin flow merging. See below fun. suspend fun method(filter: String): Flow<List<Model>> { // Search. val models: List&l
I also made another class that implements runnable to make a new thread still it's now working, Also tried with Aynctask. At last, I made a view model but still
I want my extension function to have a couple of receivers. For example, I want function handle to be able to call methods of both CoroutineScope and Iterable i
Recently I saw this - Most data sources already provide main-safe APIs like the suspend method calls provided by Room or Retrofit. Your repository can take adva
I'm trying to follow the official guidelines to migrate from LiveData to Flow/StateFlow with Compose, as per these articles: A safer way to collect flows from A
Kotlin code runBlocking { flow { for (i in 0..4) { println("Emit $i") emit(i) }} .onEach { if (it%2 == 0) delay(20
When browsing through Kotlin source code, I found that in some places NotImplementedError is thrown: public suspend inline val coroutineContext: CoroutineContex
I am currently trying to leverage kotlin coroutines more. But I face a problem: when using moshi or okhttp inside these coroutines I get a warning: "inappropri
It shows only I/Process: Sending signal. PID: xxxxx SIG: 9 I have tried to enable debug mode System.setProperty(DEBUG_PROPERTY_NAME, DEBUG_PROPERTY_VALUE_ON) b