[jira] [Commented] (FLEX-33371) On Android, changing orientation fires Event.DEACTIVATE and FlexEvent.VIEW_DEACTIVATE events

2013-01-29 Thread Erik Thomas (JIRA)

[ 
https://issues.apache.org/jira/browse/FLEX-33371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13565968#comment-13565968
 ] 

Erik Thomas commented on FLEX-33371:


Hi OmPrakash:

This is almost a perfect workaround. Unfortunately, listening for the 
NativeApplication.DEACTIVATE event to unload is not reliable. It seems to fire 
randomly and not related to orientation changes. I've only tried a couple 
times, but as I work through my app workflows, everything is working great on 
Android now, just like iOS, but something is triggering the DEACTIVATE event 
during a workflow and the app is unloading because I'm calling exit().

So I'm not out of the woods yet, but this is a huge improvement.

Erik

Erik J. Thomas
CEO | Principal Developer
E. J. Thomas & Associates, LLC 
266 Peakview Rd, Boulder, CO 80302
303-440-8384 (office) | 303-304-1466 (mobile) 
ejtho...@ejthomas.com 
CONFIDENTIALITY NOTICE: This e-mail and any attachments may contain 
confidential information that is legally privileged. The information is solely 
for the use of the intended recipient(s). Any disclosure, copying, 
distribution, or other use of this information is strictly prohibited. If you 
have received this e-mail in error, please notify the sender by return e-mail 
and delete this message.




> On Android, changing orientation fires Event.DEACTIVATE and 
> FlexEvent.VIEW_DEACTIVATE events
> 
>
> Key: FLEX-33371
> URL: https://issues.apache.org/jira/browse/FLEX-33371
> Project: Apache Flex
>  Issue Type: Bug
>  Components: Mobile: MobileApplication
>Affects Versions: Adobe Flex SDK 4.6 (Release)
> Environment: Samsung Galaxy Express and Galaxy S III Android Phones, 
> FlashBuilder 4.7 Premium on Windows 7, debugging through USB as well as 
> deployed release builds, iPhone and iPad, but the problem doesn't exist on 
> iOS devices, only Android
>Reporter: Erik Thomas
>Priority: Critical
> Fix For: Adobe Flex SDK 4.6 (Release)
>
> Attachments: AndroidDeactivateOnOrientationChangeDefect.zip
>
>
> Orientation changes on Android devices always fire the following events in 
> this order:
> ViewNavigatorEvent.VIEW_DEACTIVATE
> Event.DEACTIVATE
> StageOrientationEvent.ORIENTATION_CHANGE
> The first two events are a defect. They must not fire simply because the user 
> changed the orientation of the phone.
> The result of this defect is that we cannot do two very important things:
> 1. Use view state changes to hide/show layouts, using includeIn property on 
> containers and components. On Android, components that are not included for a 
> given state are destroyed yet they have state we want to maintain which is 
> why we don't change Views.
> 2. We cannot know when the user navigates away from our application, for 
> example to press the Home key. We have certain cleanup we must do in our 
> complex connected app that streams FMS data, etc., and cannot keep sockets 
> open for hours or days.
> On iOS, this is not a problem. Only Android has this bug and it's blocking us 
> from releasing our product on Android. iOS does not have this defect.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (FLEX-33371) On Android, changing orientation fires Event.DEACTIVATE and FlexEvent.VIEW_DEACTIVATE events

2013-01-29 Thread Erik Thomas (JIRA)

[ 
https://issues.apache.org/jira/browse/FLEX-33371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13565922#comment-13565922
 ] 

Erik Thomas commented on FLEX-33371:


Thanks Justin. OmPrakash found an obscure mention of using  manifest element and it works perfectly.

I still think this is a bug, probably in the AIR runtime, but this manifest 
entry solved my problems perfectly.

Erik

Erik J. Thomas
CEO | Principal Developer
E. J. Thomas & Associates, LLC 
266 Peakview Rd, Boulder, CO 80302
303-440-8384 (office) | 303-304-1466 (mobile) 
ejtho...@ejthomas.com 
CONFIDENTIALITY NOTICE: This e-mail and any attachments may contain 
confidential information that is legally privileged. The information is solely 
for the use of the intended recipient(s). Any disclosure, copying, 
distribution, or other use of this information is strictly prohibited. If you 
have received this e-mail in error, please notify the sender by return e-mail 
and delete this message.




> On Android, changing orientation fires Event.DEACTIVATE and 
> FlexEvent.VIEW_DEACTIVATE events
> 
>
> Key: FLEX-33371
> URL: https://issues.apache.org/jira/browse/FLEX-33371
> Project: Apache Flex
>  Issue Type: Bug
>  Components: Mobile: MobileApplication
>Affects Versions: Adobe Flex SDK 4.6 (Release)
> Environment: Samsung Galaxy Express and Galaxy S III Android Phones, 
> FlashBuilder 4.7 Premium on Windows 7, debugging through USB as well as 
> deployed release builds, iPhone and iPad, but the problem doesn't exist on 
> iOS devices, only Android
>Reporter: Erik Thomas
>Priority: Critical
> Fix For: Adobe Flex SDK 4.6 (Release)
>
> Attachments: AndroidDeactivateOnOrientationChangeDefect.zip
>
>
> Orientation changes on Android devices always fire the following events in 
> this order:
> ViewNavigatorEvent.VIEW_DEACTIVATE
> Event.DEACTIVATE
> StageOrientationEvent.ORIENTATION_CHANGE
> The first two events are a defect. They must not fire simply because the user 
> changed the orientation of the phone.
> The result of this defect is that we cannot do two very important things:
> 1. Use view state changes to hide/show layouts, using includeIn property on 
> containers and components. On Android, components that are not included for a 
> given state are destroyed yet they have state we want to maintain which is 
> why we don't change Views.
> 2. We cannot know when the user navigates away from our application, for 
> example to press the Home key. We have certain cleanup we must do in our 
> complex connected app that streams FMS data, etc., and cannot keep sockets 
> open for hours or days.
> On iOS, this is not a problem. Only Android has this bug and it's blocking us 
> from releasing our product on Android. iOS does not have this defect.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (FLEX-33371) On Android, changing orientation fires Event.DEACTIVATE and FlexEvent.VIEW_DEACTIVATE events

2013-01-29 Thread Erik Thomas (JIRA)

[ 
https://issues.apache.org/jira/browse/FLEX-33371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13565919#comment-13565919
 ] 

Erik Thomas commented on FLEX-33371:


Awesome, OmPrakash! This did the trick! I'm still getting DEACTIVATE when 
leaving the app as we needed, and we no longer get any of these bogus events 
fired for orientation changes.

I searched a lot and never saw this one. Sorry to waste your time. Hope this 
could get fixed anyway though.

Cheers,

Erik


Erik J. Thomas
CEO | Principal Developer
E. J. Thomas & Associates, LLC 
266 Peakview Rd, Boulder, CO 80302
303-440-8384 (office) | 303-304-1466 (mobile) 
ejtho...@ejthomas.com 
CONFIDENTIALITY NOTICE: This e-mail and any attachments may contain 
confidential information that is legally privileged. The information is solely 
for the use of the intended recipient(s). Any disclosure, copying, 
distribution, or other use of this information is strictly prohibited. If you 
have received this e-mail in error, please notify the sender by return e-mail 
and delete this message.




> On Android, changing orientation fires Event.DEACTIVATE and 
> FlexEvent.VIEW_DEACTIVATE events
> 
>
> Key: FLEX-33371
> URL: https://issues.apache.org/jira/browse/FLEX-33371
> Project: Apache Flex
>  Issue Type: Bug
>  Components: Mobile: MobileApplication
>Affects Versions: Adobe Flex SDK 4.6 (Release)
> Environment: Samsung Galaxy Express and Galaxy S III Android Phones, 
> FlashBuilder 4.7 Premium on Windows 7, debugging through USB as well as 
> deployed release builds, iPhone and iPad, but the problem doesn't exist on 
> iOS devices, only Android
>Reporter: Erik Thomas
>Priority: Critical
> Fix For: Adobe Flex SDK 4.6 (Release)
>
> Attachments: AndroidDeactivateOnOrientationChangeDefect.zip
>
>
> Orientation changes on Android devices always fire the following events in 
> this order:
> ViewNavigatorEvent.VIEW_DEACTIVATE
> Event.DEACTIVATE
> StageOrientationEvent.ORIENTATION_CHANGE
> The first two events are a defect. They must not fire simply because the user 
> changed the orientation of the phone.
> The result of this defect is that we cannot do two very important things:
> 1. Use view state changes to hide/show layouts, using includeIn property on 
> containers and components. On Android, components that are not included for a 
> given state are destroyed yet they have state we want to maintain which is 
> why we don't change Views.
> 2. We cannot know when the user navigates away from our application, for 
> example to press the Home key. We have certain cleanup we must do in our 
> complex connected app that streams FMS data, etc., and cannot keep sockets 
> open for hours or days.
> On iOS, this is not a problem. Only Android has this bug and it's blocking us 
> from releasing our product on Android. iOS does not have this defect.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (FLEX-33371) On Android, changing orientation fires Event.DEACTIVATE and FlexEvent.VIEW_DEACTIVATE events

2013-01-29 Thread Justin Mclean (JIRA)

[ 
https://issues.apache.org/jira/browse/FLEX-33371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13565882#comment-13565882
 ] 

Justin Mclean commented on FLEX-33371:
--

It may be a native Android issue. In native apps when when you change 
orientation the current activity is stopped and restated. 

The exiting event is probably dispatched when the application native onDestory 
method is called this can occur sometime (or even not at all) after the user 
has exited the application when the OS decides it needs more memory.

> On Android, changing orientation fires Event.DEACTIVATE and 
> FlexEvent.VIEW_DEACTIVATE events
> 
>
> Key: FLEX-33371
> URL: https://issues.apache.org/jira/browse/FLEX-33371
> Project: Apache Flex
>  Issue Type: Bug
>  Components: Mobile: MobileApplication
>Affects Versions: Adobe Flex SDK 4.6 (Release)
> Environment: Samsung Galaxy Express and Galaxy S III Android Phones, 
> FlashBuilder 4.7 Premium on Windows 7, debugging through USB as well as 
> deployed release builds, iPhone and iPad, but the problem doesn't exist on 
> iOS devices, only Android
>Reporter: Erik Thomas
>Priority: Critical
> Fix For: Adobe Flex SDK 4.6 (Release)
>
> Attachments: AndroidDeactivateOnOrientationChangeDefect.zip
>
>
> Orientation changes on Android devices always fire the following events in 
> this order:
> ViewNavigatorEvent.VIEW_DEACTIVATE
> Event.DEACTIVATE
> StageOrientationEvent.ORIENTATION_CHANGE
> The first two events are a defect. They must not fire simply because the user 
> changed the orientation of the phone.
> The result of this defect is that we cannot do two very important things:
> 1. Use view state changes to hide/show layouts, using includeIn property on 
> containers and components. On Android, components that are not included for a 
> given state are destroyed yet they have state we want to maintain which is 
> why we don't change Views.
> 2. We cannot know when the user navigates away from our application, for 
> example to press the Home key. We have certain cleanup we must do in our 
> complex connected app that streams FMS data, etc., and cannot keep sockets 
> open for hours or days.
> On iOS, this is not a problem. Only Android has this bug and it's blocking us 
> from releasing our product on Android. iOS does not have this defect.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (FLEX-33371) On Android, changing orientation fires Event.DEACTIVATE and FlexEvent.VIEW_DEACTIVATE events

2013-01-29 Thread OmPrakash Muppirala (JIRA)

[ 
https://issues.apache.org/jira/browse/FLEX-33371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13565840#comment-13565840
 ] 

OmPrakash Muppirala commented on FLEX-33371:


This particular comment on the bugbase could be a possible workaround:

"For workaround this issue, you can put  in  inside of the app.xml to avoid 
invoke Event trigger by surface Change. "

> On Android, changing orientation fires Event.DEACTIVATE and 
> FlexEvent.VIEW_DEACTIVATE events
> 
>
> Key: FLEX-33371
> URL: https://issues.apache.org/jira/browse/FLEX-33371
> Project: Apache Flex
>  Issue Type: Bug
>  Components: Mobile: MobileApplication
>Affects Versions: Adobe Flex SDK 4.6 (Release)
> Environment: Samsung Galaxy Express and Galaxy S III Android Phones, 
> FlashBuilder 4.7 Premium on Windows 7, debugging through USB as well as 
> deployed release builds, iPhone and iPad, but the problem doesn't exist on 
> iOS devices, only Android
>Reporter: Erik Thomas
>Priority: Critical
> Fix For: Adobe Flex SDK 4.6 (Release)
>
> Attachments: AndroidDeactivateOnOrientationChangeDefect.zip
>
>
> Orientation changes on Android devices always fire the following events in 
> this order:
> ViewNavigatorEvent.VIEW_DEACTIVATE
> Event.DEACTIVATE
> StageOrientationEvent.ORIENTATION_CHANGE
> The first two events are a defect. They must not fire simply because the user 
> changed the orientation of the phone.
> The result of this defect is that we cannot do two very important things:
> 1. Use view state changes to hide/show layouts, using includeIn property on 
> containers and components. On Android, components that are not included for a 
> given state are destroyed yet they have state we want to maintain which is 
> why we don't change Views.
> 2. We cannot know when the user navigates away from our application, for 
> example to press the Home key. We have certain cleanup we must do in our 
> complex connected app that streams FMS data, etc., and cannot keep sockets 
> open for hours or days.
> On iOS, this is not a problem. Only Android has this bug and it's blocking us 
> from releasing our product on Android. iOS does not have this defect.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (FLEX-33371) On Android, changing orientation fires Event.DEACTIVATE and FlexEvent.VIEW_DEACTIVATE events

2013-01-29 Thread OmPrakash Muppirala (JIRA)

[ 
https://issues.apache.org/jira/browse/FLEX-33371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13565837#comment-13565837
 ] 

OmPrakash Muppirala commented on FLEX-33371:


Ah, then this seems to be an AIR runtime issue.  You might want to get this on 
Adobe's radar.  I looked at the ViewNavigatorApplication class and I dont see 
anything fishy going on there.  

I see some other folks having this and similar issues as well:
http://forums.adobe.com/thread/1007852
http://forums.adobe.com/message/4281681#4281681

A very similar bug that was fixed recently in the latest AIR runtime:
https://bugbase.adobe.com/index.cfm?event=bug&id=3144722


Which version of AIR are you on?  

> On Android, changing orientation fires Event.DEACTIVATE and 
> FlexEvent.VIEW_DEACTIVATE events
> 
>
> Key: FLEX-33371
> URL: https://issues.apache.org/jira/browse/FLEX-33371
> Project: Apache Flex
>  Issue Type: Bug
>  Components: Mobile: MobileApplication
>Affects Versions: Adobe Flex SDK 4.6 (Release)
> Environment: Samsung Galaxy Express and Galaxy S III Android Phones, 
> FlashBuilder 4.7 Premium on Windows 7, debugging through USB as well as 
> deployed release builds, iPhone and iPad, but the problem doesn't exist on 
> iOS devices, only Android
>Reporter: Erik Thomas
>Priority: Critical
> Fix For: Adobe Flex SDK 4.6 (Release)
>
> Attachments: AndroidDeactivateOnOrientationChangeDefect.zip
>
>
> Orientation changes on Android devices always fire the following events in 
> this order:
> ViewNavigatorEvent.VIEW_DEACTIVATE
> Event.DEACTIVATE
> StageOrientationEvent.ORIENTATION_CHANGE
> The first two events are a defect. They must not fire simply because the user 
> changed the orientation of the phone.
> The result of this defect is that we cannot do two very important things:
> 1. Use view state changes to hide/show layouts, using includeIn property on 
> containers and components. On Android, components that are not included for a 
> given state are destroyed yet they have state we want to maintain which is 
> why we don't change Views.
> 2. We cannot know when the user navigates away from our application, for 
> example to press the Home key. We have certain cleanup we must do in our 
> complex connected app that streams FMS data, etc., and cannot keep sockets 
> open for hours or days.
> On iOS, this is not a problem. Only Android has this bug and it's blocking us 
> from releasing our product on Android. iOS does not have this defect.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (FLEX-33371) On Android, changing orientation fires Event.DEACTIVATE and FlexEvent.VIEW_DEACTIVATE events

2013-01-29 Thread Erik Thomas (JIRA)

[ 
https://issues.apache.org/jira/browse/FLEX-33371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13565789#comment-13565789
 ] 

Erik Thomas commented on FLEX-33371:


Hi OmPrakash:

The NativeApplication DEACTIVATE event also fires on orientation change events.

  Event.DEACTIVATE event was fired!
  NativeApplication.Event.DEACTIVATE event was fired!
  StageOrientationEvent.ORIENTATION_CHANGE event was fired!

Also, NativeApplication.EXITING never fires when the user presses the Home 
button or switches applications. This event seems useless and never fires for 
any reason.

Thanks for taking a look!

BTW, I plan to look into joining as a contributor after my current contract is 
finished, but I don't have time to do that now or I might look into this issue.

Thanks!

Erik

Erik J. Thomas
CEO | Principal Developer
E. J. Thomas & Associates, LLC 
266 Peakview Rd, Boulder, CO 80302
303-440-8384 (office) | 303-304-1466 (mobile) 
ejtho...@ejthomas.com 
CONFIDENTIALITY NOTICE: This e-mail and any attachments may contain 
confidential information that is legally privileged. The information is solely 
for the use of the intended recipient(s). Any disclosure, copying, 
distribution, or other use of this information is strictly prohibited. If you 
have received this e-mail in error, please notify the sender by return e-mail 
and delete this message.




> On Android, changing orientation fires Event.DEACTIVATE and 
> FlexEvent.VIEW_DEACTIVATE events
> 
>
> Key: FLEX-33371
> URL: https://issues.apache.org/jira/browse/FLEX-33371
> Project: Apache Flex
>  Issue Type: Bug
>  Components: Mobile: MobileApplication
>Affects Versions: Adobe Flex SDK 4.6 (Release)
> Environment: Samsung Galaxy Express and Galaxy S III Android Phones, 
> FlashBuilder 4.7 Premium on Windows 7, debugging through USB as well as 
> deployed release builds, iPhone and iPad, but the problem doesn't exist on 
> iOS devices, only Android
>Reporter: Erik Thomas
>Priority: Critical
> Fix For: Adobe Flex SDK 4.6 (Release)
>
> Attachments: AndroidDeactivateOnOrientationChangeDefect.zip
>
>
> Orientation changes on Android devices always fire the following events in 
> this order:
> ViewNavigatorEvent.VIEW_DEACTIVATE
> Event.DEACTIVATE
> StageOrientationEvent.ORIENTATION_CHANGE
> The first two events are a defect. They must not fire simply because the user 
> changed the orientation of the phone.
> The result of this defect is that we cannot do two very important things:
> 1. Use view state changes to hide/show layouts, using includeIn property on 
> containers and components. On Android, components that are not included for a 
> given state are destroyed yet they have state we want to maintain which is 
> why we don't change Views.
> 2. We cannot know when the user navigates away from our application, for 
> example to press the Home key. We have certain cleanup we must do in our 
> complex connected app that streams FMS data, etc., and cannot keep sockets 
> open for hours or days.
> On iOS, this is not a problem. Only Android has this bug and it's blocking us 
> from releasing our product on Android. iOS does not have this defect.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (FLEX-33371) On Android, changing orientation fires Event.DEACTIVATE and FlexEvent.VIEW_DEACTIVATE events

2013-01-29 Thread OmPrakash Muppirala (JIRA)

[ 
https://issues.apache.org/jira/browse/FLEX-33371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13565735#comment-13565735
 ] 

OmPrakash Muppirala commented on FLEX-33371:


Erik,

I dont have my USB cable with me, so I am not able to test your project.  Have 
you tried listening to Event.EXITING and Event.DEACTIVATE events thrown by 
NativeApplication.nativeApplication to do your cleanup?  That way, you can 
bypass the spurious viewDeactivate events by not listening to them.  The docs 
[1] seems to suggest that this is the correct way.  

I apologize if this is not related to your problem.  I will get a chance to 
look at this later tonight if you havent solved your issue by then.  

Thanks,
Om

[1] 
http://help.adobe.com/en_US/flex/mobileapps/WSa122979b4619725672e48c412a3e152164-8000.html

> On Android, changing orientation fires Event.DEACTIVATE and 
> FlexEvent.VIEW_DEACTIVATE events
> 
>
> Key: FLEX-33371
> URL: https://issues.apache.org/jira/browse/FLEX-33371
> Project: Apache Flex
>  Issue Type: Bug
>  Components: Mobile: MobileApplication
>Affects Versions: Adobe Flex SDK 4.6 (Release)
> Environment: Samsung Galaxy Express and Galaxy S III Android Phones, 
> FlashBuilder 4.7 Premium on Windows 7, debugging through USB as well as 
> deployed release builds, iPhone and iPad, but the problem doesn't exist on 
> iOS devices, only Android
>Reporter: Erik Thomas
>Priority: Critical
> Fix For: Adobe Flex SDK 4.6 (Release)
>
> Attachments: AndroidDeactivateOnOrientationChangeDefect.zip
>
>
> Orientation changes on Android devices always fire the following events in 
> this order:
> ViewNavigatorEvent.VIEW_DEACTIVATE
> Event.DEACTIVATE
> StageOrientationEvent.ORIENTATION_CHANGE
> The first two events are a defect. They must not fire simply because the user 
> changed the orientation of the phone.
> The result of this defect is that we cannot do two very important things:
> 1. Use view state changes to hide/show layouts, using includeIn property on 
> containers and components. On Android, components that are not included for a 
> given state are destroyed yet they have state we want to maintain which is 
> why we don't change Views.
> 2. We cannot know when the user navigates away from our application, for 
> example to press the Home key. We have certain cleanup we must do in our 
> complex connected app that streams FMS data, etc., and cannot keep sockets 
> open for hours or days.
> On iOS, this is not a problem. Only Android has this bug and it's blocking us 
> from releasing our product on Android. iOS does not have this defect.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (FLEX-33371) On Android, changing orientation fires Event.DEACTIVATE and FlexEvent.VIEW_DEACTIVATE events

2013-01-29 Thread Erik Thomas (JIRA)

[ 
https://issues.apache.org/jira/browse/FLEX-33371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13565697#comment-13565697
 ] 

Erik Thomas commented on FLEX-33371:


Also, listening for viewDeactivate and Deactivate events and doing an 
event.preventDefault is an oversimplified approach to working around this 
problem. The reason is the order in which these events are fired. If 
VIEW_DEACTIVATE is fired before ORIENTATION_CHANGE, how do you know what caused 
the VIEW_DEACTIVATE event to fire? If the user left the building, or simply 
changed orientation. These are two distinct situations that we must know about. 

We've tried stupid stuff like a timer that starts on VIEW_DEACTIVATE, and we 
stop it on ORIENTATION_CHANGE and if the timer runs to completion, then we know 
they didn't simply change orientation, but the timing of this approach is 
unreliable at best in our tests. We've found many corner case problems we have 
to deal with on this approach.

> On Android, changing orientation fires Event.DEACTIVATE and 
> FlexEvent.VIEW_DEACTIVATE events
> 
>
> Key: FLEX-33371
> URL: https://issues.apache.org/jira/browse/FLEX-33371
> Project: Apache Flex
>  Issue Type: Bug
>  Components: Mobile: MobileApplication
>Affects Versions: Adobe Flex SDK 4.6 (Release)
> Environment: Samsung Galaxy Express and Galaxy S III Android Phones, 
> FlashBuilder 4.7 Premium on Windows 7, debugging through USB as well as 
> deployed release builds, iPhone and iPad, but the problem doesn't exist on 
> iOS devices, only Android
>Reporter: Erik Thomas
>Priority: Critical
> Fix For: Adobe Flex SDK 4.6 (Release)
>
> Attachments: AndroidDeactivateOnOrientationChangeDefect.zip
>
>
> Orientation changes on Android devices always fire the following events in 
> this order:
> ViewNavigatorEvent.VIEW_DEACTIVATE
> Event.DEACTIVATE
> StageOrientationEvent.ORIENTATION_CHANGE
> The first two events are a defect. They must not fire simply because the user 
> changed the orientation of the phone.
> The result of this defect is that we cannot do two very important things:
> 1. Use view state changes to hide/show layouts, using includeIn property on 
> containers and components. On Android, components that are not included for a 
> given state are destroyed yet they have state we want to maintain which is 
> why we don't change Views.
> 2. We cannot know when the user navigates away from our application, for 
> example to press the Home key. We have certain cleanup we must do in our 
> complex connected app that streams FMS data, etc., and cannot keep sockets 
> open for hours or days.
> On iOS, this is not a problem. Only Android has this bug and it's blocking us 
> from releasing our product on Android. iOS does not have this defect.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (FLEX-33371) On Android, changing orientation fires Event.DEACTIVATE and FlexEvent.VIEW_DEACTIVATE events

2013-01-29 Thread Erik Thomas (JIRA)

[ 
https://issues.apache.org/jira/browse/FLEX-33371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13565693#comment-13565693
 ] 

Erik Thomas commented on FLEX-33371:


We've tried for the better part of a day to find a workaround, but we use 
orientation view states extensively and need to react to orientation changes to 
invalidate "includeIn" property on containers and components to adjust the 
layout for the appropriate orientation. On iOS, this is great. On Android, by 
the time our orientation change event is fired, the app has already deactivated 
our View and destroyed all the components. 

Unfortunately, we developed our app with two iOS devices but no Android 
devices. Instead, we tested many Android form factors using simulators. Finally 
started testing our v1 product on more devices and discovered this problem on 
devices that doesn't exist in the simulators. 

We also need to know when the user leaves our app so we can unload it because 
it's highly connected with NetStream/FMS connections, etc., and on Android, 
because viewDeactive destroys components that trigger Controller 
initialization, etc., when we lose state, we can't recreate it if the user 
comes back to the app in the same View they left without tearing it down and 
putting it all back together again. 

This should be an incredibly simple fix. In the native extension library for 
Android, when there is simply an orientation change, don't propagate DEACTIVATE 
and VIEW_DEACTIVATE events to the AIR client.

> On Android, changing orientation fires Event.DEACTIVATE and 
> FlexEvent.VIEW_DEACTIVATE events
> 
>
> Key: FLEX-33371
> URL: https://issues.apache.org/jira/browse/FLEX-33371
> Project: Apache Flex
>  Issue Type: Bug
>  Components: Mobile: MobileApplication
>Affects Versions: Adobe Flex SDK 4.6 (Release)
> Environment: Samsung Galaxy Express and Galaxy S III Android Phones, 
> FlashBuilder 4.7 Premium on Windows 7, debugging through USB as well as 
> deployed release builds, iPhone and iPad, but the problem doesn't exist on 
> iOS devices, only Android
>Reporter: Erik Thomas
>Priority: Critical
> Fix For: Adobe Flex SDK 4.6 (Release)
>
> Attachments: AndroidDeactivateOnOrientationChangeDefect.zip
>
>
> Orientation changes on Android devices always fire the following events in 
> this order:
> ViewNavigatorEvent.VIEW_DEACTIVATE
> Event.DEACTIVATE
> StageOrientationEvent.ORIENTATION_CHANGE
> The first two events are a defect. They must not fire simply because the user 
> changed the orientation of the phone.
> The result of this defect is that we cannot do two very important things:
> 1. Use view state changes to hide/show layouts, using includeIn property on 
> containers and components. On Android, components that are not included for a 
> given state are destroyed yet they have state we want to maintain which is 
> why we don't change Views.
> 2. We cannot know when the user navigates away from our application, for 
> example to press the Home key. We have certain cleanup we must do in our 
> complex connected app that streams FMS data, etc., and cannot keep sockets 
> open for hours or days.
> On iOS, this is not a problem. Only Android has this bug and it's blocking us 
> from releasing our product on Android. iOS does not have this defect.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira