[TIMOB-27177] Android: Closing root window from child causes app exit issues as of 8.0.1
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2019-08-22T14:26:56.000+0000 |
Affected Version/s | Release 8.0.1 |
Fix Version/s | Release 8.1.1 |
Components | Android |
Labels | android, close, engSchedule, exitonclose, regression, window |
Reporter | Joshua Quick |
Assignee | Joshua Quick |
Created | 2019-06-21T01:25:14.000+0000 |
Updated | 2019-08-22T14:26:56.000+0000 |
Description
*Summary:*
As of Titanium 8.0.1, there is a regression where the app exit behavior has changed after closing the root window from a child window. After closing the root window...
* Closing the immediate child window will home-out instead of exiting the app.
* Opening another child window and then closing it will cause an app exit instead of displaying the parent window.
*Steps to reproduce:*
Build and run the below code on Android.
Tap on the "Open" button in Window 1. _(Will close Window 1 after opening Window 2.)_
Tap on the "Open" button in Window 2.
Tap on the "Close" button in Window 3.
Notice the app exits. _(This is a bug. Should close Window 3 and display Window 2.)_
Relaunch the app.
Tap on the "Open" button in Window 1.
Tap on Android's Back button in Window 2.
Relaunch the app.
Notice the splash screen was *NOT* shown. _(This is a bug. App did not exit when pressing back button when it should have.)_
var window1 = Ti.UI.createWindow({
title: "Window 1",
backgroundColor: "white",
});
var openButton = Ti.UI.createButton({
title: "Open",
});
openButton.addEventListener("click", function() {
var window2 = Ti.UI.createWindow({
title: "Window 2",
backgroundColor: "white",
});
var openButton = Ti.UI.createButton({
title: "Open",
});
openButton.addEventListener("click", function() {
var window3 = Ti.UI.createWindow({
title: "Window 3",
backgroundColor: "white",
});
var closeButton = Ti.UI.createButton({
title: "Close",
});
closeButton.addEventListener("click", function() {
window3.close();
});
window3.add(closeButton);
window3.open();
});
window2.add(openButton);
window2.open();
window1.close();
});
window1.add(openButton);
window1.open();
*Work-around:*
Do not close the root window immediately after opening the child window. Instead, close the root window via the child window's "close" listener.
PR (master): https://github.com/appcelerator/titanium_mobile/pull/10988
PR (8.1.x): https://github.com/appcelerator/titanium_mobile/pull/11093
FR passed. Waiting for for 8.1.0.GA release to merge PR
PR (8.3.x): https://github.com/appcelerator/titanium_mobile/pull/11144
Merged to master, 8_3_X and 8_1_X.
*Closing ticket* fix verified in SDK version
8.2.0.v20190820104021
,8.1.1.v20190820143437
and8.3.0.v20190820103430
. Test and other information can be found at: PR (master): https://github.com/appcelerator/titanium_mobile/pull/10988 PR (8.1.x): https://github.com/appcelerator/titanium_mobile/pull/11093 PR (8.3.x): https://github.com/appcelerator/titanium_mobile/pull/11144