Vinay Gaba
11/01/2020, 9:36 PM@Composable
internal fun BackButtonHandler(onBackPressed: () -> Unit) {
Providers(
AmbientBackPressedDispatcher provides LifecycleOwnerAmbient.current as AppCompatActivity
) {
handler {
onBackPressed()
}
}
}
Ian Lake
11/01/2020, 9:51 PMLifecycleOwnerAmbient
, you probably want to start with ContextAmbient
Ian Lake
11/01/2020, 9:52 PMIan Lake
11/01/2020, 9:53 PMOnBackPressedDispatcherOwnerAmbient
that does exactly that for youVinay Gaba
11/01/2020, 9:55 PMVinay Gaba
11/02/2020, 12:03 AMOnBackPressedDispatcherOwnerAmbient
on the roadmap?Ian Lake
11/02/2020, 12:47 AMVinay Gaba
11/02/2020, 2:11 AMIan Lake
11/02/2020, 3:34 AMVinay Gaba
11/02/2020, 4:44 AMIan Lake
05/24/2023, 3:27 PM