Skip to main content
Participant
June 3, 2011
Question

navigator.pushView()

  • June 3, 2011
  • 1 reply
  • 997 views

I understand that to share data between views in a mobile application you need to pass it using the navigator.pushView() call. I've done that and it works, but now I wonder how I can pass data if the user just presses the physical back button on the mobile device.

Do I have to capture the keyboard down event like this:

navigator.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDownHandler);

and use pushView within the handler? will that cancel the original back button call completely? I wonder if there's a better way.

The use case is this: you're in the home view, the user presses a button and you gets to another view (using a pushView call). The user then makes some selections, then presses the physical back button to return to the home view. I need to pass the user selection to the home view somehow.

This topic has been closed for replies.

1 reply

Participant
June 3, 2011
iBr3nt
Inspiring
June 3, 2011

Hi,

There is a solution built-in to the Flex Mobile framework. Look at createReturnObject() discussed here in the docs:

http://help.adobe.com/en_US/flex/mobileapps/WSa122979b4619725672e48c412a3e152164-7fff.html

Check out the section called "Return data from a view"

iBrent