[TIMOB-11888] Android: 'androidback' does not work with tabGroup
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-02-23T00:24:55.000+0000 |
Affected Version/s | Release 3.0.0 |
Fix Version/s | Release 3.1.0, 2013 Sprint 04 API, 2013 Sprint 04 |
Components | Android |
Labels | api, module_tabgroup, qe-testadded |
Reporter | Hieu Pham |
Assignee | Ping Wang |
Created | 2012-11-28T23:42:31.000+0000 |
Updated | 2013-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.
And neither does android:back No way to catch this event in 3.0.0 tab groups.
@Rey. It is currently scheduled to be fixed in 3.1.0.
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
PR https://github.com/appcelerator/titanium_mobile/pull/3889
PR merged and reviewed.
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.
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