My Nexus 4 was recently updated to Android 4.3. The below code to control the system Back button worked with the previous versions of Android 4.2 and below. However, now my phone has been updated to 4.3, the Back button simply closes the app. The Back button works perfectly in the Simulator. Here is the code:
stage.addEventListener(KeyboardEvent.KEY_UP, backButton);
private function backButton(e:KeyboardEvent):void
{
if (e.keyCode == Keyboard.BACK) {
e.preventDefault();
e.stopImmediatePropagation();
clickClose(null); //Brings up a splash screen to confirm whether to close the app
}
}
Has anyone else had this problem or is there a solution to get it to work?
Thanks,
hp