Titanium JIRA Archive
Appcelerator Community (AC)

[AC-3212] Support android:back event for non-heavy windows

GitHub Issuen/a
TypeNew Feature
Priorityn/a
StatusClosed
ResolutionInvalid
Resolution Date2012-02-21T14:42:21.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsn/a
ReporterMark Burggraf
AssigneeRadamantis Torres-Lechuga
Created2012-01-22T16:27:40.000+0000
Updated2016-03-08T07:57:37.000+0000

Description

Please support the android:back event for light windows as well as heavy windows. At this time, unless a window is heavy (i.e. contains a url parameter from which all its code is derived) the android:back even does not fire on that window. As a result, in order to trap the android [hardware] back button, I need to employ a pretty extensive workaround, that includes the following steps: Attach an android:back event handler to the main (root) window. Ti.App.fireEvent when the event handler is triggered. Maintain an application-wide stack of window names. Push and pop each window's name onto the stack as it is opened and closed. Write an event handler in each window that checks to see if it's currently the top window on the stack, and if so, close the current window.

Comments

  1. Ivan Skugor 2012-01-23

    Hi Mark. To make window heavyweight on Android, you don't have to use "url" property. "url" besides creating heavyweight window, creates new context. But, to make window heavyweight, you can define its "modal", "fullscreen" or "navbarHidden" property (and that would not create new context). So, you can create window and include necessary code via "Ti.include" or "require" functions. Cheers, Ivan.
  2. Mauro Parra-Miranda 2012-02-21

    As Ivan suggested, there is a bunch of ways to get this functionality.
  3. Radamantis Torres-Lechuga 2013-12-27

    Tested with Android Samsung Galaxy Nexus SDK 3.2.0.GA Android version: 4.1.1 Test code is working, alert is showing, that means the window (lightweight) is getting the event.
  4. Shak Hossain 2013-12-28

    Closing this since the feature exists in our latest version of the SDK.

JSON Source