[TIMOB-26269] Android: Closing parent window closes current window as well
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2018-08-06T18:30:43.000+0000 |
Affected Version/s | Release 7.4.0, Release 7.2.0 |
Fix Version/s | n/a |
Components | Android |
Labels | n/a |
Reporter | Hans Knöchel |
Assignee | Unknown |
Created | 2018-08-05T22:25:19.000+0000 |
Updated | 2018-12-12T00:02:42.000+0000 |
Description
I am running into a strange situation in which the current window is closed when i call
close()
on the parent window. Is there a workaround for this? It works fine on iOS and is a common pattern for login/logout scenarios.
I'm not sure I understand what the issue is. Is your child window closing the parent window? And is the parent window the root window of the app? I ask because, on Android, the default native behavior when closing the root activity window is to exit the app. This is not the native behavior on iOS, but it is on Android. If you don't want it to work this way, then you need to set the root window's "exitOnClose" property to
false
. This will override that behavior. https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Window-property-exitOnCloseI think that was indeed the issue! The root-window needed
exitOnClose: false
and then it worked. However, I am curious if that brings new glitches now.There is a known issue with "exitOnClose" written up here: [TIMOB-26213] In summary, if you close a child window programmatically, the "exitOnClose" property is ignored by the root window. But this is not an issue when closing the root window directly. _*Edit:* This issue will be solved in Titanium 7.2.1_