Category "android-livedata"

How to deal with viewholder and flow in recyclerview?

I would like to use my variable flow to save integer and keep him. Then every viewholder in recyclerview observe flow and react if it is clicked. For example: I

ViewModel updates on screen rotation

I've created a simple project to study Kotlin and Android architecture https://github.com/AOreshin/shtatus The screen consists of RecyclerView and three EditT

Difference of setValue() & postValue() in MutableLiveData

There are two ways that make change value of MutableLiveData. But what is difference between setValue() & postValue() in MutableLiveData. I could not find

Filtering a recyclerview list using map or switchmap

I've been trying to figure this out for 2 days now - I just can't seem to get it to work! I'm using MVVM with a Repository pattern. Could someone tell me what I

Caused by java.lang.IllegalStateException: Couldn't read row 281, col 0 from CursorWindow with Room

I am getting this exception with my DAO in Room, at what seems random moments: Caused by java.lang.IllegalStateException Couldn't read row 281, col 0 from Curs

MutableLiveData: Cannot invoke setValue on a background thread from Coroutine

I'm trying to trigger an update on LiveData from a coroutine: object AddressList: MutableLiveData<List<Address>>() fun getAddressesLiveData(): Live