Created
March 19, 2019 09:28
-
-
Save alaershov/99c7dedf1ff63cf82c03a503dff9721e to your computer and use it in GitHub Desktop.
Back press handling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun onBackPressed() { | |
val fragment = supportFragmentManager.findFragmentById(R.id.layout_container) | |
if (fragment != null | |
&& fragment is BackButtonListener | |
&& fragment.onBackPressed()) { | |
return | |
} else { | |
super.onBackPressed() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment