Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11888] Android: 'androidback' does not work with tabGroup

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2013-02-23T00:24:55.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sRelease 3.1.0, 2013 Sprint 04 API, 2013 Sprint 04
ComponentsAndroid
Labelsapi, module_tabgroup, qe-testadded
ReporterHieu Pham
AssigneePing Wang
Created2012-11-28T23:42:31.000+0000
Updated2013-07-17T09:30:07.000+0000

Description

'androidback' does not work with tab groups.
var tabgroup = Ti.UI.createTabGroup({navBarHidden: true});
var win1 = Ti.UI.createWindow();
var tab1 = Ti.UI.createTab({window: win1, title: 'tab1'});
tabgroup.addTab(tab1);
tabgroup.open();

win1.addEventListener('androidback', function() {
   alert("hello");
});
Testing steps: 1. Run code 2. Hit back button 3. Alert should pop up, but application closes instead.

Comments

  1. Mark Mokryn 2013-01-21

    And neither does android:back No way to catch this event in 3.0.0 tab groups.
  2. Rey Bumalay 2013-02-11

  3. Ingo Muschenetz 2013-02-11

    @Rey. It is currently scheduled to be fixed in 3.1.0.
  4. Vishal Duggal 2013-02-19

    With the 3.0.0 release we moved windows within tabgroups from heavyweight to lightweight windows. So the windows no longer fire these events. These event handlers must instead be attached to the tab group itself. Will update docs for the same
       //This will work.
       tabgroup.addEventListener('androidback', function() {
          alert("hello");
       });
       
       
  5. Ping Wang 2013-02-19

    PR https://github.com/appcelerator/titanium_mobile/pull/3889
  6. Benjamin Hatfield 2013-02-22

    PR merged and reviewed.
  7. Rey Bumalay 2013-02-23

    For confirmation, I think this bug has been fixed starting 3.0.2 not 3.1. We tested androidback tabgroup event on 3.0.2 and it seem to work.
  8. Shyam Bhadauria 2013-02-25

    Code is working fine when used 'tabgroup.addEventListener' instead of 'win1.addEventListener'. Environment used for verification - Titanium SDK: 3.1.0.v20130223030327 Titanium SDK: 3.0.0.GA Titanium SDK: 3.0.2.GA Titanium  Studio:3.0.2.201302141201 Device : Samsung GALAXY Note Android 2.3.6

JSON Source