Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26269] Android: Closing parent window closes current window as well

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionInvalid
Resolution Date2018-08-06T18:30:43.000+0000
Affected Version/sRelease 7.4.0, Release 7.2.0
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterHans Knöchel
AssigneeUnknown
Created2018-08-05T22:25:19.000+0000
Updated2018-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.

Comments

  1. Joshua Quick 2018-08-06

    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-exitOnClose
  2. Hans Knöchel 2018-08-06

    I 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.
  3. Joshua Quick 2018-08-06

    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_

JSON Source