The app.js in the example folder demonstrates the issue:
- Unzip the module
- Build the module ('ant')
- Create a new Titanium application in Studio
- Copy the app.js from the module's example folder into your application
- Run the application
- Notice that the label displays 'Jeff 555-1212'. The 'Jeff' comes from the propertyAccessor and the '555-1212' comes from the custom property.
- Hit the Android Back button (the activity closes but the process is still active)
- Tap on the application in the Android app launcher
- Notice that the label displays 'undefined 555-1212'. You can also see the 'E/Proxy ( 2221): Unable to lookup Proxy.prototype.getProperty' error message in the log.
For further weirdness, uncomment lines 29-31 in the app.js file and re-run steps 5-8 again. This time you will notice that everything works correctly. The only difference here is that a 2nd instance of the proxy is being created with a call from JS rather than the one that is being created internally.
A couple of observations:
The onStop and onDestroy methods are getting called when the activity closes (check the messages output to the log file)
The process is still active after closing the activity
On the 2nd launch of the main activity you will notice a log message that it is registering an existing module again even though the module was supposedly destroyed. Probably expected behavior, but perhaps not.
I've tried a number of different things but have not been able to change this behavior. Any clues, suggestions, etc. are greatly appreciated.