[TIMOB-1238] Android application lifecycle issues: app activity can be destroyed, but app still not terminated
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2017-06-05T21:08:52.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android |
Labels | android, defect, lifecycle |
Reporter | Bill Dawson |
Assignee | Ingo Muschenetz |
Created | 2011-04-15T02:47:24.000+0000 |
Updated | 2017-06-05T21:08:52.000+0000 |
Description
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.
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.
(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...
Closing ticket due to the time passed and lack of progress over the past few years.