E Smits
06/17/2020, 9:32 AMobject NavStatus {
var currentScreen by mutableStateOf<Screen>(Screen.Home)
}
fun navigateTo(destination: Screen) {
NavStatus.currentScreen = destination
}
This is fine if you specify onclicks in the UI. However the hardware button closes the app. Usually you would handle an onKeyListener in your fragments or onBackPress in an activity. I could imagine that you could keep an array of recent navigated screens and just pop one using the onbackpress listener in the MainActivity.Theo
06/17/2020, 9:37 AME Smits
06/17/2020, 9:43 AMIan Lake
06/17/2020, 1:42 PMVinay Gaba
06/17/2020, 4:25 PME Smits
06/17/2020, 5:05 PM