[TIMOB-1238] Android application lifecycle issues: app activity can be destroyed, but app still not terminated

GitHub Issuen/a
Resolution Date2017-06-05T21:08:52.000+0000
Affected Version/sn/a
Fix Version/sn/a
Labelsandroid, defect, lifecycle
ReporterBill Dawson
AssigneeIngo Muschenetz


Stems from http://developer.appcelerator.com/helpdesk/view/20811">http://developer.appcelerator.com/helpdesk/view/20811. In that case, user would back out of program and TiRootActivity's onDestroy would get called, but yet the Application would never terminate. (TiApplication.onTerminate never hit breakpoint). When user launched the application again, it was more like a resume, since it had never terminated. This meant that the same instance of TiApplication was being used, and singletons such as those maintained in TiModule's modules hashmap were still alive. This leads to weird stuff, since the application "kinda" terminated but didn't really.

To be very specific regarding that helpdesk issue: when user backed out of program, AppModule's onDestroy removed itself from TiApplication's appEventProxies collection. When the app started up again, the AppModule singleton was still alive, which means its constructor did not run again, which means it was never added back to the Application's appEventProxies collection. So no calls to Ti.App.fireEvent worked.


  1. Marshall Culpepper 2011-04-15

    I have a regression that falls under this heading, but I'm not sure if this is the right bug to attach it to. I'll go ahead and tag it, but we might want to resolve this since we fixed the module singleton instance problem already.

  2. Marshall Culpepper 2011-04-15

    (from [dac0b4dec18678c1f5e9701fe2bdae7f5bb24895]) clean up singleton modules and event managers in context onDestroy, this lets event listeners work when the app has been relaunched. removed impl of File.spaceAvailable() (it was Java6 only, we'll need to find another way) [#1238] [#1842] http://github.com/appcelerator/titanium_mobile/commit/dac0b4dec18678c1f5e9701fe2bdae7f5bb24895"> http://github.com/appcelerator/titanium_mobile/commit/dac0b4dec1867...

  3. Lee Morris 2017-06-05 Closing ticket due to the time passed and lack of progress over the past few years.

JSON Source