Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
55 views

Developing app using Room and Compose. I want to achieve the following: User opens Screen A with list of parent categories. User opens Screen B by clicking category: during the navigation, app passes ...
DJ-Glock's user avatar
  • 1,453
4 votes
1 answer
124 views

I’m using Jetpack Compose with StateFlow in a ViewModel. I have a Map<String, List<Int>> and I want to sort it by the size of each list, then display the sorted result in the UI. Inside my ...
Ahmad Njres's user avatar
1 vote
1 answer
112 views

I'm working on a Jetpack Compose app where I fetch book data from a server using a BooksViewModel. The UI should update based on the state (Loading, Success, or Error). However, the UI only shows the ...
Vivek Modi's user avatar
  • 7,859
2 votes
2 answers
231 views

I have created a compose project that follows the standard architecture sttucture of a project. It has a data class, interface, api class, repository. The repository is connected to a viewmodel and ...
CodeNerd's user avatar
0 votes
0 answers
116 views

I am using Jetpack Compose with a NavHost and NavHostController to handle navigation. I have a dialog that appears when a button is clicked. This dialog includes a button that navigates to another ...
Andrej Plavsic's user avatar
1 vote
1 answer
140 views

I am trying to better understand how StateFlow can be used by writing simple code in a scratch file in Android Studio. I just want to update a StateFlow and collect the result. The code is the ...
eqtèöck's user avatar
  • 1,115
1 vote
1 answer
42 views

I have this code for image analysis, and I'm trying to pass the processed text data list to the view model. The text is recognized, but it doesn't get properly sent to the view model. I logged the ...
Gábor Madový's user avatar
0 votes
2 answers
83 views

I'm writing a simple todo app using compose and stateflow. data class Task( val name: String, val isCompleted: Boolean, val date: Long ) class SomeViewModel : ViewModel() { private ...
HukeLau_DABA's user avatar
  • 2,536
1 vote
1 answer
49 views

Whenever I trigger the "FavoritePost" or "DeletePost" and the uiState has TAB_TWO (Favorites) selected it either swaps to TAB_ONE, stays in TAB_TWO but displays all the Posts ...
Andrei-Alin Dulceanu's user avatar
4 votes
2 answers
136 views

I have a ViewModel with a stateFlow. Everytime that a button is clicked, I'm changing the value to the state but, for some reason, the screen is not reacting to that change. I know that the state's ...
juske's user avatar
  • 310
0 votes
1 answer
210 views

I have a Repository + UseСase + ViewModel + MVI architecture. I have a UseCase for collecting Flow, and another UseCase to update Flow in repository When I go to the screen, collect fires and gives me ...
onesector's user avatar
  • 471
2 votes
2 answers
189 views

In my application, when updating the map StateFlow is not updated. Help me update StateFlow correctly. data class PageData(val selectedCheckbox: Int, val enable: Boolean) @HiltViewModel internal ...
Ruslan's user avatar
  • 55
1 vote
1 answer
91 views

When the first page results (20) are scrolled down and when there are new results from the next page the screen flickers/refreshes. Tried many things but no idea how to stop this screen flickering. ...
AndroidDev's user avatar
  • 5,635
1 vote
1 answer
105 views

In my application I get the list of films by api and can add them to the list of favourites which is stored in the database room. So on the screen with the list of favourite films when I try to delete ...
alexxelo's user avatar
1 vote
1 answer
265 views

I investigated for hours and searched the web (and even bothered ChatGPT) and I'm puzzled this hasn't been solved yet to my (obviously very limited) knowledge. So this is the setup: I have a view ...
nepa's user avatar
  • 1,472
1 vote
1 answer
43 views

I Have the following sealed class sealed class SearchedState { data class FoundCrag(val crag: Crag): SearchedState() data class FoundZone(val zone: Zone) : SearchedState() data class ...
juske's user avatar
  • 310
0 votes
0 answers
89 views

I am building an app and I am using Flow and State. I have 2 fragments A and B. They are never displayed at the same time. In each fragment I am observing the change of state as below: private fun ...
Seb's user avatar
  • 3,255
1 vote
1 answer
1k views

I'm using a MutableMap to save the data which is updates every 5 seconds and I expect also to be updated the UI showing part of the Map. After trying different solution I found that if I add another ...
Georgy G's user avatar
2 votes
1 answer
368 views

I'm trying to achieve the following behavior on my TODO app: when user touches a circle in the top bar a date is selected and the tasks list must change to show tasks of that date when user touches a ...
pochopsp's user avatar
  • 1,150
1 vote
1 answer
215 views

Created below MutableStateFlow for understanding how collecting works using StateFlow. Is the below code valid? How we can right correctly? val _mutableStateFlow = MutableStateFlow(0) val stateFlow: ...
r_dev's user avatar
  • 31
2 votes
2 answers
898 views

I have a viewmodel class that uses a StateFlow that is created using the StateIn operator. I.E. private val _state = MutableStateFlow(MyState()) private val myItems = myRepository.myFlow.stateIn( ...
tomerpacific's user avatar
  • 6,851
1 vote
3 answers
290 views

I have a fragment that shows a location after collecting it from the viewmodel stateflow, the location is stored in shared preferences than emitted to a mutableflowstate when the fragment starts. The ...
Jamal N's user avatar
  • 698
4 votes
3 answers
5k views

I'm encountering a situation where a MutableStateFlow in my Kotlin code isn't emitting the same value twice in a row, even when I explicitly call emit() with the same value. This is preventing my ...
MohammadBaqer's user avatar
1 vote
0 answers
152 views

I am currently migrating an android application from XML, Databinding and Flow/LiveData to Compose, Flow/StateFlow. In this application, I have a very simple Room database: @Entity data class User(@...
rolandl's user avatar
  • 1,907
1 vote
0 answers
49 views

Test Result is always received first value(=init) and last value(=success) How to get LoaderType State (Fail Case) Without the delay() function, the test case consistently fails, and only the initial ...
Jayden's user avatar
  • 11

1
2 3 4 5 6