Copy link to clipboard
Copied
Hi there!
I have tried SO MANY methods to PREVENT the default function of Back button in Android but no success
This is one of the codes I have used with no success:
stage.addEventListener(KeyboardEvent.KEY_UP, optionsKey, false, 0, true);
function optionsKey(ke:KeyboardEvent):void
{
if (ke.keyCode == Keyboard.BACK)
{
ke.preventDefault();
ke.stopImmediatePropagation();
//Do my own code below...
}
}
I am using Flash Cs6 , Air 3.2 for Android , Testing it on LG Google nexus 4.
When I use the flash simulator, it works fine! Means the Back Button, let the App go back to previous step (as I expect it to do)
But after I publish the apk (Aspect ratio: Auto , Auto orientation , Render mode: GPU), as soon as I press BACK, it minimize my app!
(means when i press the Back button on my phone, the App minimize down (not close!). when I re-activate it/click on it, I see the app has actually gone one step BACK (as I programmed and expected), but I just CANT STOP the default action of MINIMIZING/De-activating my app after pressing Back button.
Anyone have any "Fla" file that I can see it in ACTION please?!
Because I have used many-many codes and no success yet
thanks and looking forward for your any kind of hlep...
Message was edited by: Pouradam
I got my own answer thanks to myself!!
in above code .KEY_UP should be changed to .KEY_DOWN.
simple!
Copy link to clipboard
Copied
No answer???? ....
Copy link to clipboard
Copied
I got my own answer thanks to myself!!
in above code .KEY_UP should be changed to .KEY_DOWN.
simple!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now