SyntaxFix
Write A Post
Hire A Developer
Questions
Override the onBackPressed() method as per the example by codeMagic, and remove the call to super.onBackPressed(); if you do not want the default action (finishing the current activity) to be executed.
onBackPressed()
super.onBackPressed();