Skip to main content
Participating Frequently
April 22, 2013
Question

Cancel back button action on android under the air

  • April 22, 2013
  • 5 replies
  • 957 views

Hello,

I do the following, but anyway when I touch back button the topmost view is popped from the navigator's stack.




private function key_down_handler(event: KeyboardEvent): void



{




if (event.keyCode == Keyboard.BACK)




{





event.stopPropagation();





event.stopImmediatePropagation();





event.preventDefault();




}



}

How to prevent this?

Thanx in advance.

This topic has been closed for replies.

5 replies

Adobe Employee
April 24, 2013

Are you using a flex app?

It could be that flex is getting this event before your code does.

Could you please try increasing the the priority of you event listner, when adding the listener using the addEventListener call.

Colin Holgate
Inspiring
April 24, 2013

It's the key_up event that you need to trap, not the key_down one.