NavHostOnBackPressedManager

class NavHostOnBackPressedManager
kotlin.Any
   ↳ androidx.navigation.NavController.NavHostOnBackPressedManager

Class returned by setHostOnBackPressedDispatcherOwner(OnBackPressedDispatcherOwner) to allow the NavHost to manually disable or enable whether the NavController should actively handle system Back button events.

Summary

Public methods

Unit

Set whether the NavController should handle the system Back button events via the registered OnBackPressedDispatcher.

Public methods

enableOnBackPressed

fun enableOnBackPressed(enabled: Boolean): Unit

Set whether the NavController should handle the system Back button events via the registered OnBackPressedDispatcher.

Parameters
enabled Boolean: True if the NavController should handle system Back button events.