Navigating Between Screens
Move forward and back between destinations.
Moving Forward
Once your NavHost is set up, you move to another screen by calling navigate on the NavController with the target route.
navController.navigate("details")Triggering from a Button
Navigation usually happens in a callback, such as a button's onClick.
Button(onClick = { navController.navigate("details") }) {
Text("Open details")
}All lessons in this course
- Setting Up NavHost
- Navigating Between Screens
- Passing Arguments
- Bottom Navigation