OnBack Pressed deprecated

OnBack Pressed deprecated in kotlin so, use below code

onBackPressedDispatcher.addCallback(

this,

object : OnBackPressedCallback(true) {

override fun handleOnBackPressed() {

overridePendingTransition(R.anim.activity_slide_in_left, R.anim.activity_slide_out_right)

}

}

)


Sign In or Register to comment.