Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
47 views

In my Android application, I have a UserViewModel that handles various user-related operations (registration, login, username update, password change, etc.). The problem is that after one of these ...
Kian Mahmoudi's user avatar
1 vote
2 answers
67 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
0 votes
0 answers
74 views

I have inherited a WearOS app, which needs to use the watch sensors to record health data, such as heart rate, temperature and acceleration. The app is made in Java, is around 7 years old and it doesn'...
theproductivepickle's user avatar
0 votes
0 answers
36 views

I have a Fragment that contains several CheckBoxes: class TestFragment : Fragment() { private lateinit var checkBox2er: CheckBox private lateinit var checkBox3er: CheckBox // ... ...
BenjyTec's user avatar
  • 12.6k
4 votes
2 answers
327 views

In the Android documentation it says the following: Dispatchers.IO - This dispatcher is optimized to perform disk or network I/O outside of the main thread. Examples include using the Room component, ...
A. Cedano's user avatar
  • 1,069
1 vote
1 answer
294 views

Can someone help me correct the logic of reordering list. I believe the moveTodo function in viewmodel is not working properly. Reordering is working but not like how it should. Project Structure ..db ...
Harsh Vardhan's user avatar
2 votes
1 answer
228 views

sorry for the English, I'm using a translator.i'm just a beginner, please consider this when replying.i know the code may not be the best. this is just a start. I'm using the viewmodel to create a ...
Ramon Xavier's user avatar
0 votes
2 answers
207 views

So, I've got a database collection thing I am working on. The main view is just a list of all the stuff in the database, and I'm currently trying to add optional filtering by certain parameters. I ...
sardonicus87's user avatar
0 votes
1 answer
306 views

I've searched everywhere and I can't find any answers that make any sense, and every answer I tried I could find, causes the app to crash instantly. I even got desperate and asked Gemini for help, ...
sardonicus87's user avatar
1 vote
1 answer
157 views

I am trying to upgrade my java code to kotlin but I don't know how to aproach this transition. It seems that I have to perfectly understand corutines which is a pain because it seems too much all at ...
Chris's user avatar
  • 125
1 vote
2 answers
140 views

I have an endpoint https://api.openweathermap.org/data/2.5/weather?q=sukkur,pk&appid=5*****************c I want to use retrofit to make call to this end point interface WeatherApiService { @...
Arshad Ali's user avatar
  • 3,284
1 vote
2 answers
775 views

How can I pass a String parameter to a ViewModel in Compose? I mean a string variable, not a hardcoded one or an Application stored one. I need to pass it as a parameter. This is just for learning ...
NullPointerException's user avatar
0 votes
2 answers
772 views

I am new to MVVM architecture, I have tried with different options but still getting same exception "cannot able to create an instance ViewModel". I am using Android Studio Iguana below is ...
Naveen's user avatar
  • 993
0 votes
1 answer
175 views

I'm working on an Android app using Kotlin, Jetpack Compose, and Hilt for dependency injection. Despite following the recommended setup for Hilt, I keep encountering a runtime exception when trying to ...
Diadem's user avatar
  • 501
1 vote
0 answers
80 views

I have a very simple list on the screen. Data goes from viewmodel state from database as observable flow (very ordinary case) List item is very simple: it has id, name, order_ (the order of item in ...
Foenix's user avatar
  • 558
0 votes
0 answers
66 views

I am trying to implement favoriting feature in my application using room db. I am storing the data from an API call and present it using the ViewModel and MutableLiveData. The problem I going through ...
Unish Raj.'s user avatar
1 vote
1 answer
903 views

I was just dealing with clean architecture in Android apps and MVVM. I heard that you shouldn't pass your ViewModel directly to the screen (I use Jetpack Compose) but rather its states and every ...
JokerGrAp's user avatar
10 votes
1 answer
2k views

I'm working on an Android Compose project where I'm using Paging 3 along with a LazyColumn to display a list of items fetched from a network call. The default behavior of Paging 3 is to load pages ...
Kartheek's user avatar
  • 7,225
0 votes
1 answer
195 views

Say in the OrderScreen, we have OrderViewModel(orderRepository) and UserViewModel(userRepository). Approach #1: class OrderViewModel(private val orderRepository: OrderRepository) : ViewModel() { ...
Sam Chen's user avatar
  • 9,150
0 votes
0 answers
86 views

I am working on a Jet Shopping App using Room DB with reference from HOODLAB youtube video & my full code is build without error. Problems: When I am adding an item to the list, it is not showing....
Kaushalendra Singh's user avatar
0 votes
3 answers
51 views

In my login page when I click on login button with valid email and password, then it goes into homepage. and then when i logged out from there and redirect to login page . then i face is when i clicks ...
Asikur Rahman's user avatar
1 vote
1 answer
350 views

Product Item Composable : @Composable fun ProductItem(product: Product, index: Int) { val addProductViewModel = hiltViewModel<AddProductVM>() val productSelectedIndex = remember { ...
SasidharanIOS's user avatar
1 vote
2 answers
1k views

I have a list like this data class SelectedNtrItem( val items:ArrayList<NutritionSearchItem> = arrayListOf() ) I need to use this list on two composable screens, so I need to ...
NewPartizal's user avatar
  • 1,298
0 votes
2 answers
82 views

Say, I have two Views. One is button, second is textView. When I click button, something changes in text. If I make it in MVVM, probably it should look like this: There are button and text view which ...
Helkor's user avatar
  • 41
0 votes
2 answers
822 views

I'm trying to make an app that can enter and store Bible Verses. I'm using Dagger Hilt to inject my Daos into my View Model . My App keeps crashing whenever I try to use viewModel to get my state and ...
Archie Nshindano's user avatar
-1 votes
1 answer
220 views

I want to fetch news from remote and map network response to entity class to store in room database in repository layer. i am using separate data class for both remote and database Here are the data ...
Techchai Mobile's user avatar
0 votes
3 answers
3k views

I've noticed that in some of my Android projects, I'm able to access ViewModel and LiveData classes without explicitly adding the following dependencies to my build.gradle file: implementation("...
Eeman's user avatar
  • 185
0 votes
1 answer
81 views

My project is having feature1Module and feature2Module. These 2 are included in app module build gradle file. implementation project(":feature1Module") implementation project(":...
G Anil Reddy's user avatar
0 votes
0 answers
64 views

I have been trying to make a simple program where I will get data from Retrofit API calling into RecyclerView using MVVM architecture with JAVA, but I am not getting any data from Retrofit API into ...
Himanshu Satone's user avatar
0 votes
1 answer
95 views

When I download info from a DataBase the collect function doesn’t stop emission (Kotlin's collect function doesn't terminate itself.) I have this entity class: @Entity data class ShareEntity( @...
Евгений s's user avatar
0 votes
0 answers
139 views

I have two use cases UseCase A and UseCase B which access the same repository Repo X. Repo X makes a API (data.com/getUserInfo) call to get certain data. ViewModel 1 has need for only UseCase B, while ...
kk_1807's user avatar
  • 11
4 votes
2 answers
4k views

Here is my MainActivity.kt file Surface(modifier = Modifier.fillMaxSize(), color = MaterialTheme.colorScheme.background) { NavigationHoster() } here is navhoster ...
Gayantha's user avatar
  • 538
0 votes
1 answer
99 views

I'm developing a simple math practice game with .NET MAUI MVVM. I want the highScore value on the main page of the game to be updated after I close the application and re-enter it every time I play. ...
M3rtixius's user avatar
-1 votes
1 answer
98 views

I want to display the score information I earned on the MultiplicationPage on the GameOverPage. I think I pulled the data from PlayerModal but it still doesn't show up. GameOverPage.xaml <?xml ...
M3rtixius's user avatar
0 votes
1 answer
71 views

Using the MVVM Design Pattern I am developing a basic operations math application.When I give a wrong answer, my score and counter score increase as if I answered correctly. I used some artificial ...
M3rtixius's user avatar
0 votes
1 answer
154 views

In this application that I developed with MVVM, counter, question, score and answer were displayed on the screen before adding the Observable feature. When I added the Observable feature, these ...
M3rtixius's user avatar
0 votes
1 answer
128 views

MultiplicationPage.xaml <?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="...
M3rtixius's user avatar
0 votes
1 answer
80 views

MauiProgram.cs using MauiApp1.Sevices; using MauiApp1.ViewModels; using MauiApp1.Views; using Microsoft.Extensions.Logging; namespace MauiApp1; public static class MauiProgram { public static ...
M3rtixius's user avatar
0 votes
1 answer
943 views

I have two fragments, and I want to access the todoId from the ViewModel of the second fragment, but I am encountering issues while trying to access it. Here is the problem I am facing: E/...
Ashif Ali's user avatar
0 votes
1 answer
77 views

I'd like the variable listOfPoints to change every time when workout.points is changed or every "x" seconds. var listOfPoints = emptyList<LatLng>() var workoutId = viewModel....
xMaster's user avatar
  • 51
1 vote
1 answer
1k views

//From Kotlin code (Compose View), using CoroutineScope scope.launch { viewModel.getDataOne(key) viewModel.data_one.collect{ one -> when(one){ is DataState.Success->{ ...
Lloyd Munyai's user avatar
0 votes
1 answer
2k views

Using the monarchy realm database, a dao gives liveData. A repository gives that liveData to a useCase as a flow using .asFlow on the liveData. The useCase needs to return the flow to a ViewModel ...
Sagar Patel's user avatar
0 votes
1 answer
2k views

I tried to test the ViewModel using Junit and Mockito, getting null pointer exception. It returns cannot invoke flow collector. I want to test the responses coming in MpinDataKey, check all parameters ...
Cijo K Paul's user avatar
0 votes
1 answer
471 views

I'm unable to resolve this error. I wanted to use two-way databinding in edittext. Here is the code for the layout file. <?xml version="1.0" encoding="utf-8"?> <layout ...
Anmol Agrawal's user avatar
0 votes
1 answer
853 views

I am working on a requirement, where as when making a service call to the API, if it is success, the response object will be a set of key-value in the following format: string : {string: string} For ...
Long Dao's user avatar
  • 1,381
0 votes
1 answer
24 views

My CustomScroll Listener class is . This is separate class class CustomScrollListener(): RecyclerView.OnScrollListener(){ override fun onScrollStateChanged(recyclerView: RecyclerView, newState: ...
Karthik . N's user avatar
0 votes
1 answer
179 views

I have an Android project where I use MVVM. This is the structure: src \_ domain \_ model \_ repository \_ ItemsRepository \_ data \_ repository \_ ...
Always Learner's user avatar
2 votes
2 answers
4k views

I have chat like interface in Jetpack compose. Every message can either be Text, Audio, Video, or Image. Each Audio message is displayed with the help of a AudioPlayer composable, and an attached ...
thedroiddiv's user avatar
1 vote
1 answer
871 views

I'm new here, grateful to meet you all here. I have an error like this based on my Logcat. java.lang.RuntimeException: Unable to start activity ComponentInfo{com.voidcreativestation.toko/com....
K La's user avatar
  • 11
0 votes
1 answer
63 views

I have a toolbar with a menu that contains a custom button at the end and I want to change the text of this button according to the fragment's position in a view pager. But when I call the function ...
Tarek Idrees's user avatar

1
2 3 4 5
16