I am a beginner trying to learn Kotlin by changing an old tutorial to Compose. I have a ViewModel with and Fragment with: How could I adapt thi ...
I am a beginner trying to learn Kotlin by changing an old tutorial to Compose. I have a ViewModel with and Fragment with: How could I adapt thi ...
How to handle ViewModel clear focus event in JetPackCompose? I have a coroutines channel that sometimes notify my screen to clear the TextField focus ...
My setup is: java Activity getting a ViewModel using Koin. All good with this, but when I rotate a phone, the ViewModel is always recreated. So how to ...
My scenario is like this: I have a one activity architecture of my app, and I have multiple fragments, which I navigate to using the NavController obj ...
I have the below code You notice the var todoList is var. Since it get initialize only once, I hope to make it val. How is that possible, given it ...
I have a common situation of getting data. I use the Kotlin Coroutines. 1 variant: 2 variant: How can I initialize a data field not delayed, bu ...
I have a view model that gets search query data string every time a user enter a text in my text field in the Top App Bar. The view model is as follo ...
I have created a LazyRow in jetpack compose. At a certain point in the viewmodel, I want to get the list of currently visible items from that LazyRow. ...
I have the below code to check the live network connection state. How can I call the function to start checking for this network connection state fro ...
I have search view model like this. searchPoiUseCase doing requests to Room DB. For testing purposes i am using Room.inMemoryDatabaseBuilder. On th ...
On various occasions I've seen people use Kotlin Flows when retrieving a list of objects from a local database, but nowhere have I noticed any warning ...
I am using activity. Finish() to close an application on logout. However, when the application is opened back up again, my coroutines do not launch, m ...
I have the following code in my view model. I'm using jetpack navigator and it work well the first time the screen is created, but when I go to ano ...
I am following unidirectional flow in compose for ui state so basically i have sealed class as follow and in viewmodel At first api will call on ...
I've created a view model in Jetpack Compose, but the view doesn't refresh when a variable updates inside it. I've followed the view model guide here ...
How would I access data from a deep-link inside of an Android's Architecture Components ViewModel at its init-time. I have access to extras provided i ...
When I try to create the ViewModel via viewModel(), I receive the following error: My application looks like this: MainActivity class MainActivit ...
So I have Two ViewModels in my Calculator App in which I all reference in my Compose NavGraph so I can use the same ViewModel instance. I set a Boolea ...
Android documentation says that composable functions can run in parallel: https://developer.android.com/jetpack/compose/mental-model#parallel It mean ...
If I call lets say some function A in init block of View Model which will update live data and after that I m observing this live data in onViewCreate ...