Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15790] Android: TabGroup: Opening tab in tabgroup of large tabs, crashes the app

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionInvalid
Resolution Date2013-11-22T18:50:15.000+0000
Affected Version/sRelease 3.2.0
Fix Version/s2013 Sprint 24, 2013 Sprint 24 API
ComponentsAndroid
Labelsqe-3.2.0, regression, triage
ReporterParas Mishra
AssigneePing Wang
Created2013-11-22T07:44:43.000+0000
Updated2013-12-17T06:54:41.000+0000

Description

Android: TabGroup: Opening tab in tabgroup of large tabs, crashes the app It works fine on SDK: 3.1.3.GA Steps to reproduce: 1. Run the below app.
var _window = Ti.UI.createWindow({
    backgroundColor : 'red'
});

	    function createTab(_i)
	    {
		    return Ti.UI.createTab({window: _window, title: 'Tab ' + _i});
		}
		 
		var tabGroup = Ti.UI.createTabGroup();
		 
		for (var i = 0; i < 10; i++)
		{
		    var tab = createTab(i);
		     
		    tabGroup.addTab(tab);
		}
		 
		
		setInterval(function()
		{
		    var tabs = tabGroup.tabs;
		    var string = '';
		     
		    for (var i = 0; i < tabs.length; i++)
		    {
		        string += ' | ' + tabs[i].title;
		    }
		     
		   
		     
		}, 5000);

 tabGroup.open();
2. Click on any tab. Expected: Tab should open and app should not crash. Actual: Opening a ab, app crashes.

Comments

  1. Pedro Enrique 2013-11-22

    This is bad test case, the same instance of the window is used on multiple tabs. Refactored the code and this does not crash.
       function Window() {
           return Ti.UI.createWindow({
               backgroundColor : 'red'
           });
       } 
       function createTab(_i) {
           return Ti.UI.createTab({window: Window(), title: 'Tab ' + _i});
       }
         
       var tabGroup = Ti.UI.createTabGroup();
         
       for (var i = 0; i < 10; i++) {
           var tab = createTab(i);
           tabGroup.addTab(tab);
       }
         
       setInterval(function() {
           var tabs = tabGroup.tabs;
           var string = ''; 
           for (var i = 0; i < tabs.length; i++) {
               string += ' | ' + tabs[i].title;
           }
       }, 5000);
        
       tabGroup.open();
       
  2. Ping Wang 2013-11-22

    Resolved the ticket as Invalid based on the above comment.
  3. Pragya Rastogi 2013-12-17

    Verified fix with : OSX: 10.8.5 Xcode: 5.0 Appcelerator Studio:3.2.0.201312151544 SDK:3.2.0.v20131216191854 alloy: 1.3.0-cr2 acs: 1.0.10 npm: 1.3.2 titanium: 3.2.0-cr3 titanium-code-processor: 1.1.0-cr2 Device: Nexus 7 (v4.3)

JSON Source