Category "viewmodel"

Why recomposition happens when call ViewModel in a callback?

I completely confused with compose conception. I have a code @Composable fun HomeScreen(viewModel: HomeViewModel = getViewModel()) { Scaffold { val

Store data and "Cannot create an instance of class ViewModel" - Hilt - Room - JetpackCompose

I try to store some days from ScheduleScreen screen. Lib uses in theme topic. While I was doing this, I had two questions: why i got this error Cannot create an

How to use navGraphViewModels in Activity (Not in Fragment)

In Fragment, we can use ViewModel scoped to navigation Graph. private val viewModel: ViewModel by navGraphViewModels(R.id.youNavGraphID) But how to create View

Composable not recomposing when ViewModel updated from a different Composable

I am developing an Android app using Jetpack Compose. The app shows a list of items. It also has a top bar containing a search bar. We have 3 composable: the li

Android MVVM - How to reference Activity in ViewModel

MVVM architecture, this is my View (Activity): private MyApp app; private MainActivityVM viewModel; @Override protected void onCreate(Bundle savedInstanceSta

Returning BadRequest in method that returns PartialViewResult

I have an MVC5 application that has a method populates and returns a partial view. Since the method accepts an ID as a parameter, Id like to return an error if