[TIMOB-10916] Android: TabGroup - tabGroup.activeTab returns null instead of object
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-09-18T13:43:39.000+0000 |
Affected Version/s | Release 3.0.0 |
Fix Version/s | Release 3.0.0, Sprint 2012-19 API, 2012 Sprint 19 |
Components | Android |
Labels | api, module_tabgroup, qe-review, qe-testadded, regression |
Reporter | Anshu Mittal |
Assignee | Hieu Pham |
Created | 2012-09-14T04:30:39.000+0000 |
Updated | 2014-01-23T18:07:57.000+0000 |
Description
tabGroup.activeTab returns null instead of object.
This is regression since the issue does not occur on 2.1.2 GA.
Steps to reproduce:
1. Create an app using the code below.
2. Launch the app. and check logs.
Expected:
Activetab should return object.
Actual:
Activetab returns null.
var win1 = Ti.UI.createWindow({
title: 'Win 1'
});
var button = Ti.UI.createButton({
color: '#000',
style: Ti.UI.iPhone.SystemButtonStyle.BORDERED,
title: 'Set Active Tab 1'
});
button.addEventListener('click', function(e) {
tabGroup.setActiveTab(1);
Ti.API.info('****************** activeTab: ' + tabGroup.activeTab);
});
win1.add(button);
var tab1 = Ti.UI.createTab({
icon: 'KS_nav_ui.png',
title: 'Tab 1',
window: win1
});
var win2 = Ti.UI.createWindow({
title: 'Win 2'
});
var tab2 = Ti.UI.createTab({
icon: 'KS_nav_views.png',
title: 'Tab 2',
window: win2
});
var tabGroup = Ti.UI.createTabGroup({
});
tabGroup.addTab(tab1);
tabGroup.addTab(tab2);
tabGroup.open();
Ti.API.info('********************* activeTab: ' + tabGroup.activeTab);
This issue only happens on master. 2_1_X works fine. It is probably caused by this [PR](https://github.com/appcelerator/titanium_mobile/pull/2794). Removed "merge-2.1.3" from Labels.
Tested with: SDK:3.0.0.v20121019153308 Studio: 3.0.0.201210141844 Device: LG-p970(Android 2.2.2) tabGroup.activeTab returns object
Anvil testcase PR https://github.com/appcelerator/titanium_mobile/pull/5074