In order to check when the ‘BACK’ button is pressed, use onBackPressed() method from the Android library . Next, perform a check to see if the ‘BACK’ button is pressed again within 2 seconds and will close the app if it is so. Otherwise, don’t exit.
In order to check when the ‘BACK’ button is pressed, use onBackPressed() method from the Android library . Next, perform a check to see if the ‘BACK’ button is pressed again within 2 seconds and will close the app if it is so. Otherwise, don’t exit.