Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-27177

Android: Closing root window from child causes app exit issues as of 8.0.1

    Details

    • Story Points:
      7
    • Sprint:
      2019 Sprint 13, 2019 Sprint 14, 2019 Sprint 15, 2019 Sprint 16, 2019 Sprint 17

      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:

      1. Build and run the below code on Android.
      2. Tap on the "Open" button in Window 1. (Will close Window 1 after opening Window 2.)
      3. Tap on the "Open" button in Window 2.
      4. Tap on the "Close" button in Window 3.
      5. Notice the app exits. (This is a bug. Should close Window 3 and display Window 2.)
      6. Relaunch the app.
      7. Tap on the "Open" button in Window 1.
      8. Tap on Android's Back button in Window 2.
      9. Relaunch the app.
      10. 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.

        Attachments

          Activity

            People

            • Assignee:
              jquick Joshua Quick
              Reporter:
              jquick Joshua Quick
              Reviewer:
              Gary Mathews
              Tester:
              Keerthi Mahalingam (Inactive)
            • Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Source Code