Tangan Onback Ditekan di Fragemnt 2021 Kotlin

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    // Listen to Back button clicks
    val callback = requireActivity().onBackPressedDispatcher.addCallback(this) {
        // Handle the back button event
    }
}
Amused Albatross