Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1536] Android: TabGroup.activeTab returns index when should be tab object, AND index is wrong

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:56:27.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.6.0 M01
ComponentsAndroid
Labelsandroid, defect, release-1.6.0, tabGroup, tabgroup
ReporterBill Dawson
AssigneeDon Thorp
Created2011-04-15T02:55:21.000+0000
Updated2011-04-17T01:56:27.000+0000

Description

Test case app.js:


Titanium.UI.setBackgroundColor('#000');
var tabGroup = Titanium.UI.createTabGroup();

for (var i = 0; i < 4; i++) {
    var win = Ti.UI.createWindow({
        title: 'Tab ' + i,
        backgroundColor: '#fff'
    });
    var tab = Ti.UI.createTab({
        title: 'Tab ' + i,
        window: win
    });
    tabGroup.addTab(tab);
}

tabGroup.addEventListener('focus', function(e) {    
    Ti.API.info('tabGroup.activeTab: ' + tabGroup.activeTab);
    Ti.API.info('tabGroup.activeTab.title: ' + tabGroup.activeTab.title);
});
        
tabGroup.open();

tabGroup.activeTab will return index of the previous tab you were on, not the activeTab. In fact, according to our docs, it should return the tab object of the current tab.

Comments

  1. Marshall Culpepper 2011-04-15

    (from [0ebb6cb682acafca9b062a649c9708a0ff5aa034]) Merge branch 'master' of https://github.com/dizzymonkey/titanium_mobile">https://github.com/dizzymonkey/titanium_mobile [#1536 state:fixed-in-qa] https://github.com/appcelerator/titanium_mobile/commit/0ebb6cb682acafca9b062a649c9708a0ff5aa034"> https://github.com/appcelerator/titanium_mobile/commit/0ebb6cb682ac...

  2. Thomas Huelbert 2011-04-15

    G2 - 2.2.1, G1 - 1.6 emulator 2.1 Titanium SDK version: 1.6.0 (01/06/11 08:47 8b2fd0e). verified correct behavior on iOS 4gt ipod touch

JSON Source