title: AIR 3.1.0.4880 InvokeEvent Defect
body: <p>Recently upgraded to the AIR 3.1 SDK and have run into a show stopping issue regarding InvokeEvent on mobile devices.  The application is dispatching a new InvokeEvent each and every time you change orientation on the device.  And it isn't clearing the "queuedEvents" array.  Worst of all, the new event it dispatches each time is a clone of the last one recieved.  In the case of our application, this would be parameters that tell the application to load certain data.  So each time you change orientation, the application re-triggers that load sequence, causing lots of undersirable behavior.</p>
  
  <p>The code is pretty simple to test out:</p>
  
  <pre><code>protected function preinitializeHandler(event:FlexEvent):void
  {
      NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE, onInvoke);
  }
  
  protected function onInvoke(event:InvokeEvent):void
  {
      trace(event.toString());
  }
  </code></pre>
  
  <p>Now each time you change orientation you will see the trace statement and the event.target.queuedEvents collection continues to grow while never clearing any of the previously caught events out.</p>
  
  <p>Rolling back to AIR 3.0 fixes this behavior.  And I've been able to demonstrate that in two separate projects.</p>
  
  <p>I'd love to hear of a fix or work around so we can release using 3.1, but either way, I thought I'd make others aware of this issue as I haven't been able to find anything about it through my searching.</p>
  
  <p>For additional details on hardware: This doesn't occur in emulator or my LG Slate, but it does happen every time on both of our Xooms and our Samsung Galaxy Tab.  It doesn't appear to be an issue with iOS.</p>
  
  <p>UPDATE: Just updated to the 3.2 release candidate (3.2.0.2060) and the problem remains.  Our software wont be able to update past 3.0 for the foreseeable future, which means we can't upgrade to Flex 4.6 SDK either, not without removing a significant feature of our application.  This doesn't inspire us to the future of AIR in our company.</p>
  
  <p>There are a few solutions and work around we might be able to employ to fix our specific feature, but there is still a concern over the effects of having an ever ballooning invoke queue that never clears.  That could have additional issues over extended use of the application.</p>
  
  <p>UPDATE 2: I put more details in the Adobe forum post. <a href="http://forums.adobe.com/message/4278518" rel="nofollow">http://forums.adobe.com/message/4278518</a></p>
  
  <p>Eric Jensen</p>