All Questions
1,089
questions
-1
votes
1
answer
48
views
stateFlow value changes, but subscribers are not notified
I use koin and jetpack compose. and when I update the stateFlow value, subscribers are not informed and there is no recomposition in the composable functions.
part of code in view model:
private val ...
1
vote
1
answer
30
views
Android Kotlin/Compose ViewModel - two SateFlows for two separate fucntions to one StateFlow for UI ViewModel?
Firstly, I'm not a developer or anything, but I wanted an app that doesn't exist for my phone and I understand a minimal amount of coding, went through the Android Kotlin/Jetpack Compose basics course,...
0
votes
0
answers
32
views
Firebase realtime database always return null list while using viewmodel
Firebase realtime database always return null list while using viewmodel/livedata. But if I use the same code in Fragment itself it works.
this is my viewmodel
package com.example.taxinfo.viewmodel
...
0
votes
0
answers
30
views
java.lang.RuntimeException: Unable to start activity ComponentInfo{}: java.lang.reflect.InvocationTargetException
I am trying to use MVVM with Room DB in my android app but getting this exception on the splashActivity.
It was working fine until i added viewmodel and observers
class SplashActivity : ...
0
votes
2
answers
108
views
java.lang.IllegalStateException: Reading a state that was created after the snapshot was taken or in a snapshot that has not yet been applied
I am working on a very basic snake game using kotlin and jetpack compose. To make it more efficient, I thought of using coroutines, but I keep getting the above mentioned error.
Full project is shared ...
1
vote
2
answers
60
views
Switching from .first() to .collect{} on a Flow stopped data appearing on screen
I did a viewmodel with Flow and Room that connected my variables on the UiState with Room using .first() as the codelabs showed me. I noticed that using .first() is not a good idea because when I ...
-1
votes
1
answer
44
views
Android Application crashes due to late init variable Fregment Context not been initialized
I am working with the android application which sometimes gives the late init fragment context not initialized issue when user opens the dialog in application. Following is the sample code segment how ...
1
vote
1
answer
74
views
Room.kt - Database_Impl does not exist
I am trying to implement Database in a fresh app, but for some reason it's crashing and after a lot of searches I am posting this issue, I did not find anything relevant:
FATAL EXCEPTION: main (Ask ...
0
votes
0
answers
20
views
How can I add multiple dots using decorator in my calendar?
I am using the prolificinteractive material-calendarview, and I also have schedules in the calendar. I already have 1 dot to represent that the day has a schedule on it.This is what my calendar looks ...
0
votes
0
answers
22
views
Fragment is not loading
Im trying to implement Room but when the app is opened a progress bar is coming and the fragment is not starting .
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: ...
1
vote
2
answers
36
views
LiveData with data class doesn't update in ViewModel
I want to use my data class AuthData in my MainViewModel.
package de.hsfl.appamigos.capturetheflag
import androidx.lifecycle.MutableLiveData
data class AuthData(var game: MutableLiveData<String&...
0
votes
1
answer
21
views
How to pass JSON data into mvvm model with multipart in Android kotlin?
My JSON data I will pass into an API:
{
"restaurantId" : "073d9089-e318-4133-9364-671b4c47a874",
"name" : "Sayaji",
"address" : "...
0
votes
1
answer
56
views
How to properly check if location service was turned on, after back from the settings to app
I have an app, which should check on start, whether the location service is on, or off. I've tried to play around with AlerDialog, and sending user to the settings via Intent, but it doesn't work as I'...
2
votes
2
answers
326
views
Viewmodels in android using mvvm and jetpackcompose
I'm new to MVVM and trying to create an application.
The app has 4 different parts:
Profile (login - edit Profile and etc)
Categories (shows cats and subcats)
Items (show all items, single item page, ...
0
votes
0
answers
52
views
How to finish the kotlin flow from inside the method called in this flow?
sorry for any mistakes and my english, it is my first question here (feedback welcome :) )
I have got a method that returns a flow. This flow at first emits Resource.Loading, then emits the expected ...