Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10946] Android: TabGroup focus event is not fired when setActiveTab is called on the first tab

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-10-14T23:39:23.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sRelease 3.0.0, Sprint 2012-19 API, 2012 Sprint 19, Release 3.2.0
ComponentsAndroid
Labelsapi, module_tabgroup, qe-review, qe-testadded, regression
ReporterHieu Pham
AssigneeHieu Pham
Created2012-09-17T17:52:59.000+0000
Updated2014-01-23T18:07:57.000+0000

Description

1. Run this code:
var win1 = Ti.UI.createWindow({
    title: 'Win 1'
});
   
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.setActiveTab(tab1);
tabGroup.open();
tabGroup.addEventListener('focus', function(e) {
    Ti.API.info('--------------------Focus tab index: ' + e.index);
});
2. Look at the log for the focus tab message. Expected behavior: Log message should be printed. Actual behavior: Log is not printed.

Comments

  1. Anshu Mittal 2012-10-25

    Tested with: SDK:3.0.0.v20121024144610 Studio: 3.0.0.201210220122 Device:HTC Desire V(Android 4.0.3) TabGroup focus event is not fired when setActivetab is called on the first tab.
  2. Anshu Mittal 2012-11-07

    TabGroup focus event is fired successfully on android when setActivetab is called on the first tab.
  3. Anshu Mittal 2013-09-17

    Tested with: SDK: 3.1.3.v20130916153052 Appcelertaor Studio: 3.1.3.201309132456 OS: OSX 10.8.4 Device: iPod touch2(iOS7) Xcode: 5.0 GM seed alloy@1.2.2-cr CLI version : 3.1.2 setActiveTab is not called for the first time on iOS
  4. Allen Yeung 2013-10-14

    According to the comment, this fails on iOS not Android. Closing this as resolved.
  5. Dhirendra Jha 2013-10-22

    Test Environment - Appc Studio - 3.2.0.201310181700 SDK - 3.2.0.v20131021142445 acs - 1.0.7 alloy - 1.2.2 titanium - 3.2.0 titanium-code-processor - 1.0.3 Xcode - 5.0 OS - Mountain Lion (10.8.5) Devices - Nexus 7(v4.2.1), Galaxy Note (v2.3.6) Result - TabGroup focus event is fired successfully on android when setActivetab is called on the first tab. Hence closing this issue.
  6. Shameer Jan 2013-12-10

    Anvil testcase PR https://github.com/appcelerator/titanium_mobile/pull/5074

JSON Source