Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3063] Android: Ti.UI.currentWindow not respected on back button click (Android)

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionCannot Reproduce
Resolution Date2012-08-30T16:02:46.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsapi
Reporterz3nd
AssigneeNeeraj Gupta
Created2011-04-15T03:35:50.000+0000
Updated2017-03-21T22:32:44.000+0000

Description

Hi. I'm using Android APIs 2.2 and Titanium 1.5.1.

I'm trying to implement a menu button which fires an event to the current window (i.e. Window A) on click. This window also contains a button which opens another modal window (i.e. Window B). I can only access Window B from Window A.

When I open Window B (the modal window) first, and then hit the back button to go back to window A, Ti.UI.currentWindow points towards the modal window, Window B instead of Window A. I fired an event from the menu button click, and this event was caught by the modal window instead of the window which I am currently in (after pressing the back-button).

Here is some code to try out:

app.js: http://pastie.org/1535949">http://pastie.org/1535949

winA.js: http://pastie.org/1535954">http://pastie.org/1535954

winB.js: http://pastie.org/1535956">http://pastie.org/1535956

Comments

  1. Mario 2011-04-15

    Hi, I'm using android APIs 2.2 and Titanium 1.6.

    I noticed similar problems.
    The Ti.UI.currentWindow, Ti.UI.currentTab and Ti.UI.currentTabGroup are not updated when using the back key on my HTC desire.

    Best regards,

    Mario

  2. Junaid Younus 2012-08-30

    Tested on a Samsung Galaxy S2 using TiSDK 2.2.0v20120830102513, unable to reproduce the issue. The app seems to fire the correct event (window A). Ticket marked as resolved.
  3. Lee Morris 2017-03-21

    Closing ticket as the issue cannot be reproduced and due to the above comments.

JSON Source