Skip to main content
Filter by
Sorted by
Tagged with
1 vote
0 answers
63 views

I'm facing a strange issue that only occurs in the release build of my Android app (signed and uploaded to Google Play). In debug mode, everything works perfectly. After publishing or installing the ...
Richard Krammer's user avatar
0 votes
1 answer
130 views

I have a RecylcerView List of CardViews. Each CardView holds user data that is saved in a Room database. Some of the CardViews have due dates that have been entered by the user with a TimePicker. I ...
AJW's user avatar
  • 1,587
1 vote
1 answer
43 views

the logic i wish to implement is that i'm current at my MagicLinkScreen where user enter email, if email is valid it forward user to another screen that open mails app. Now when i navigate back from ...
Fatima Jamal's user avatar
3 votes
2 answers
102 views

I am using the same view model/composable pair for a creation form and an edit form. In the creation form, the text input starts as empty, but in the edit form, the initial text input comes from the ...
Eva's user avatar
  • 4,950
3 votes
1 answer
128 views

I'm developing an Android app that gathers a list of currently installed apps, both system & user-installed, and displays them on screen via LazyColumn using a Card composable. And when the user ...
Ryan Barillos's user avatar
7 votes
5 answers
5k views

I am confused what to use, whether to use update or copy for changing/updating the state of UI in Jetpack Compose. Some say to use _uiState.update { it.copy() } Some say to use _uiState.value = ...
Abhay Sharma's user avatar
0 votes
1 answer
88 views

So, i have a composable, a viewmodel and a repository. I am fetching data from Firebase's Firestore, and it already has some documents in the collection i am fetching from. These are the snippets of: ...
Avdhoot Gole's user avatar
83 votes
4 answers
32k views

After migrating the Hilt version from 2.33-beta to 2.35 my project has stopped building with the error given below: A txt version: error: cannot access DefaultActivityViewModelFactory class ...
Patryk Kubiak's user avatar
1 vote
1 answer
501 views

For the moment I use this approach in my ViewModel: private val _email = MutableStateFlow("") val email: StateFlow<String> = _email.asStateFlow() fun updateEmail(email: String) { ...
Always Learner's user avatar
0 votes
1 answer
68 views

I can't figure how to retrieve a single item from my database using it's "id", here's my code: NoteDao.kt: @Dao interface NoteDao { @Query("SELECT * FROM notes ORDER BY date DESC&...
user26376492's user avatar
2 votes
1 answer
47 views

I am developing an Android application for a university project that simulates a supermarket e-shop. The app interfaces with the REST API of the products database using Retrofit2 and Moshi, with the ...
able_wig's user avatar
45 votes
9 answers
27k views

How can we pass parameter to viewModel in Jetpack Compose? This is my composable @Composable fun UsersList() { val myViewModel: MyViewModel = viewModel("db2name") // pass param ...
ArtixModernal's user avatar
55 votes
6 answers
22k views

In Dagger Hilt View Model 1.0.0-alpha01 implementation "androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha01" implementation 'com.google.dagger:hilt-android:2.28-alpha' kapt '...
Elye's user avatar
  • 61.3k
1 vote
2 answers
46 views

I am developing my android app in kotlin which has a bottom navigation drawer and one fragment is contact fragment, in that fragment need the contact access and we can add that contact to emergency ...
Jatin Kumar's user avatar
2 votes
1 answer
417 views

I encountered the following compile-time error while using Hilt and Ksp for dependency injection: Cannot find symbol import xyz.linglitel.lmusic.viewmodel....
lin's user avatar
  • 25
3 votes
4 answers
3k views

I'm currently facing the following problem and hope someone might be able to help: I have a flow in my ViewModel that provides me with some data. Now I would like this data to be reloaded on pull-to-...
Thomas Cirksena's user avatar
1 vote
2 answers
63 views

I want to modify my Android ViewModel code, which currently uses LiveData, so that the LiveData objects are cleared or reset after they have been consumed by the UI. This is to prevent the UI from re-...
Kian Mahmoudi's user avatar
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
2 answers
108 views

i am trying manage multiple exoplayer instances or screen which are working independently. the issue i am having is stop and releasing a single player. if i am releasing / stopping first player on ...
Sonika Batth's user avatar
4 votes
2 answers
537 views

I have a nested component structure in Jetpack Compose where a deeply nested component needs to interact with a ViewModel. I'm trying to determine the best approach for handling this interaction. Here'...
Pawandeep Singh's user avatar
4 votes
1 answer
270 views

I've read through a couple of developer.android.com articles trying to understand how to structure UI with elements, states, events, and so on, but I don't really get how to implement it exactly. I've ...
Jan Thürmann's user avatar
0 votes
1 answer
6k views

I'm writing an Android app with Compose and a Room database. I've got a working solution, but I'm unsure if I'm using best practices. I'm collecting two flows in my ViewModel's init so I can create ...
tronman's user avatar
  • 10.2k
103 votes
6 answers
85k views

Are ViewModels independent of activity/fragment lifecycles or just their configuration changes. When will they cease to exist and the subsequent onCleared() method called. Can the viewModel be shared ...
ir2pid's user avatar
  • 6,256
1 vote
1 answer
116 views

I am implementing a weather app using Jetpack Compose. It includes a function to choose the temperature unit (Celsius or Fahrenheit). Whenever the temperature unit is changed, the data should refresh. ...
Gnua Aruht's user avatar
0 votes
2 answers
648 views

I have a simple ViewModel with a state that keeps some data. State is initialized in the init function of my ViewModel: ViewModelState.kt data class ViewModelState( val myInfo: String = "&...
Nadi-Shuddhi's user avatar

1
2 3 4 5
38