0 Replies Latest reply on Apr 27, 2012 12:06 AM by jln646v

    How to completely quit a native extension in flex 4.6

    jln646v Level 1



      I am writing a flex mobile app that runs on both android and ios.  My problem is, sometimes I will encounter an error in a native extension and the best way to correct it would be to signal flex to completely quit the native extension and remove it from memory, and relaunch the extension clean. 


      I have not been able to do as much testing on ios as android but on android, even though I run finish() on the activity it seems to remain in memory, because when I relaunch it from AS it will be where I left off.

      If I encounter a memory error or I can't connect to the camera, I display an error message and when the user hits ok it is supposed to run finish() and signal AS to set the reference to the extension to null, but when the user relaunches the extension, the error message is still there instead of launching clean. 


      The only way I can find to do what I want is to completely quit the AIR app and relaunch it.



      There is a dispose() method in the extension but I cannot seem to find how to make it run when I want to.  From what Ive read it runs when the Native Extension is about to be removed from memory, which is exactly what I would like to do.


      If any part of my question isn't clear or you would like more information please let me know.

      Any help is greatly appreciated.

      Thank you