How to avoid the delay of almost 1 second when back button is pressed in home fragment
I have one activity application with multiple fragments, Onbackpressed function is working correctly while I go to the other fragment from the home fragment it's working correctly but when I am on the home fragment and press the back button then it finishes the activity but there is the delay of almost 1 second which is not acceptable, how to avoid it. Here is my back-pressed function.
override fun onBackPressed() {
val count = supportFragmentManager.backStackEntryCount
if(count ==...