Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16330] Android: app requires two back events to close main window

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionWon't Fix
Resolution Date2014-03-26T22:58:52.000+0000
Affected Version/sRelease 3.2.0
Fix Version/s2014 Sprint 06, 2014 Sprint 06 SDK, Release 3.3.0
ComponentsAndroid
Labelsmodule_android, parity, qe-closed-3.3.0, qe-testadded, regression
ReporterDustin Hyde
AssigneeIngo Muschenetz
Created2014-01-27T21:18:29.000+0000
Updated2014-07-22T10:27:50.000+0000

Description

Android: app requires two back events to close main window. Regression. Works in: Alloy 1.2.2 Titanium SDK 3.1.3.GA Appcelerator Studio 3.1.3 Stable Samsung Galaxy S3 Mini 4.1.2 OS X 10.9.1 Test Steps: 1. Package default alloy android app. 2. Run app. 3. Press device 'back'. Result: Background image appears, app does not close. Workaround is to press 'back' twice. Expected Result: App closes.

Attachments

FileDateSize
alloy_1.3.1-beta4.png2014-01-27T21:18:29.000+0000195552

Comments

  1. Tim Poulsen 2014-01-28

    I can confirm that this is an issue. However, I see the same behavior with a TiClassic app. So, this isn't an Alloy problem. Testing methodology: I created two apps, one Alloy and one Classic. I compiled both using Alloy 1.3.0 / Ti3.2.0.GA. Both exhibit the behavior described (first tap of Back returns to splash screen, second exits app). I then compiled both using Alloy 1.2.2 / Ti3.1.2.GA. Both exit correctly on the first tap of the Back button.
  2. Hieu Pham 2014-01-28

    This is expected behavior. Starting with 3.2.0.GA, all windows are backed by an activity. So if you open a window, you have an activity on top of the root activity. Hitting the 'back' button closes an activity, therefore you would need to click it twice to close the app.
  3. Tim Poulsen 2014-01-28

    But this really breaks user expectations. On the main screen of an app, users expect hitting Back will exit the app and return them to the home screen. I know that developers can add exitOnClose=true to their window definition to support this. However, this was never required before and will force developers to update all their apps. The platform should handle the special case of the first/primary window in the app.
  4. Ingo Muschenetz 2014-03-14

    [~vduggal] to create tickets on fragments which is the proper solution to this. In the meantime, we need to advertise the workaround for this by using exitOnClose=true more aggressively.
  5. Hieu Pham 2014-03-26

  6. Olga Romero 2014-04-24

    Packaged the default alloy app, using CLI command
        ti build -p android -T dist-playstore
       
    Had to press device "back" only once to close main window. Appcelerator Studio, build: 3.3.0.201404221437 Titanium SDK, build 3.3.0.v20140422163054 Node.JS Version: v0.10.13 NPM Version: 1.3.2 ├── acs@1.0.14 ├── alloy@1.4.0-dev ├── node-appc@0.2.0 ├── npm@1.3.2 ├── titanium@3.3.0-dev └── titanium-code-processor@1.1.1-beta1 npm -g ls titanium: /usr/local/lib └── titanium@3.3.0-dev (git://github.com/appcelerator/titanium.git#93414d143051df4578b7aa42670008e5ef02c422) Device: Nexus 4 Android version 4.2

JSON Source