flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Thomas (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLEX-33371) On Android, changing orientation fires Event.DEACTIVATE and FlexEvent.VIEW_DEACTIVATE events
Date Tue, 29 Jan 2013 19:37:12 GMT

    [ 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
> --------------------------------------------------------------------------------------------
>                 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
> 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

View raw message