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

Android: Calling finish() on root splash screen activity should exit the app

    Details

    • Story Points:
      3
    • Sprint:
      2018 Sprint 25, 2018 Sprint 26, 2019 Sprint 1

      Description

      Summary:
      Calling Activity.finish() on the root splash screen activity should automatically close all child windows/activities and exit out of the app.

      It should only work this way for the root activity. Finishing/closing an activity in the middle of the stack should not automatically close the child activities.

      Note:
      This is mostly needed for Titanium apps launched via the Java startActivityForResult() method. In this case, the Titanium developer must call the Activity.setResult() method on the root activity and exit out to respond to the other app with the result. You typically call Activity.finish() just after Activity.setResult() when following Google's examples.

      Steps to reproduce:

      1. Build and run with the below code on Android.
      2. Tap on the "Close" button.
      3. Notice that the app does not exit out.

      var rootActivity = Ti.Android.currentActivity;
      var window = Ti.UI.createWindow();
      var button = Ti.UI.createButton({ title: "Close Root Activity" });
      button.addEventListener("click", function() {
      	rootActivity.finish();
      });
      window.add(button);
      window.open();
      

        Attachments

          Activity

            People

            • Assignee:
              jquick Joshua Quick
              Reporter:
              jquick Joshua Quick
              Reviewer:
              Gary Mathews
            • Watchers:
              3 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