skip to Main Content

Android Studio – how to pass viewModel as parameter in NavHost compose navigation

I have to following NavHost: NavHost( navController = navController, startDestination = Destinations.ComposeEntryPointRoute ) { composable<Destinations.HomeRoute> { HomeContent() } composable<Destinations.GradeConverterRoute> { GradeConverterScreen(navController = navController, gradeConverterViewModel = DONT KNOW WHAT TO DO HERE) } } I don't know how to pass the…

VIEW QUESTION

Android Studio – "error: package R does not exist" in Navigation after adding Assets folder: Android Studio

Since adding an Assets folder to my project I now get: error: package R does not exist "return new ActionOnlyNavDirections(R.id.action_newAlarmFragment_to_homeFragment);" which is from this auto generated code: import androidx.annotation.NonNull; import androidx.navigation.ActionOnlyNavDirections; import androidx.navigation.NavDirections; public class SetNewAlarmFragmentDirections { private SetNewAlarmFragmentDirections() {…

VIEW QUESTION

Android Studio – BottomNavigationView's menu not selected after navigating to other fragment, switching to other menu, and switching back to initial menu

I'm building an android application with 3 menus using bottom navigation. I created new project in Android Studio using Bottom Navigation Activity. I renamed the fragment to: InfoFragment.kt DetectFragment.kt AboutFragment.kt Renamed the layout in src/main/res/layout to: fragment_info.xml fragment_detect.xml fragment_about.xml Renamed…

VIEW QUESTION
Back To Top
Search