Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10017] Android: TableView: Child window contains tableview.App crashes on second visit to child window from parent window.

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionCannot Reproduce
Resolution Date2013-11-13T22:38:30.000+0000
Affected Version/sRelease 2.1.1, Release 3.1.0
Fix Version/s2013 Sprint 23, 2013 Sprint 23 API
ComponentsAndroid
Labelsapi, exalture, qe-closed-3.3.0
ReporterShyam Bhadauria
AssigneeBiju pm
Created2012-07-18T05:11:55.000+0000
Updated2014-07-17T10:37:09.000+0000

Description

This is not a regression. It occurs in 2.1.0 and 2.0.2 as well. From parent window, going to child window for the second time crashes the app. Steps to reproduce: 1) Use the code below to make a sample app.
var winMain = Ti.UI.createWindow({
    backgroundColor : 'white',
    fullscreen : true,
});

var SecWin= Ti.UI.createWindow({
    backgroundColor : 'red',
    fullscreen : true,
});

var ClickMe = Ti.UI.createButton({
    title : 'Click',
    backgroundColor:'orange',
    width : 60,
    height : 40
});

ClickMe.addEventListener('click',function() {
		SecWin.backgroundColor = 'white';
		var tableView = Ti.UI.createTableView();
		
		var data = [];
		
		for (var c=0;c<4;c++)
		{
			var label = Ti.UI.createLabel({
				text:'Header ' + (c+1),
				color:'black',
				width:'auto',
				height: 'auto',
				left:4
			});
			
			var pinkHeader = Ti.UI.createView({backgroundColor: 'pink', height: 40});
			pinkHeader.add(label);
			
			data[c] = Ti.UI.createTableViewSection({
				headerView: pinkHeader
			});
			for (var x=0;x<10;x++)
			{
				data[c].add(Ti.UI.createTableViewRow({title:'Group '+(c+1)+', Row '+(x+1)}));
			}
		}
		
		tableView.data = data;
		
		SecWin.add(tableView);
		SecWin.open();
});


winMain.add(ClickMe);
winMain.open();
2) Run the app. 3) Click the button'Click' 4) Press android 'back' button. 5) Click the button'Click' Expected result: 2) After step 2, a white window with a 'click' button should get displayed. 3) The child window with pink header rows should get displayed. 4) Earlier white parent window should get displayed. 5) The child window should get displayed again. Actual result: 2) After step 2, a white window with a 'click' button gets displayed. 3) The child window with pink header rows gets displayed. 4) Earlier white parent window gets displayed. 5) App is forced closed.

Comments

  1. Ping Wang 2013-01-23

    PR: https://github.com/appcelerator/titanium_mobile/pull/3607
  2. Ping Wang 2013-01-25

    Another test case:
       var win1 = Ti.UI.createWindow({
       	backgroundColor : 'white',
       	title : "win1",
       	fullscreen : true
       });
       
       var win2 = Ti.UI.createWindow({
       	backgroundColor : 'red',
       	title : "win2",
       	fullscreen : true
       });
       
       var b1 = Ti.UI.createButton({
       	title : 'Open win2',
       	backgroundColor : 'orange',
       	width : 160,
       	height : 80
       });
       
       b1.addEventListener('click', function() {
       	win2.backgroundColor = 'blue';
       	var tableView = Ti.UI.createTableView({
       		top : 100
       	});
       
       	var data = [];
       
       	for (var c = 0; c < 4; c++) {
       		var label = Ti.UI.createLabel({
       			text : 'Header ' + (c + 1),
       			color : 'black',
       			width : 'auto',
       			height : 'auto',
       			left : 4
       		});
       
       		var pinkHeader = Ti.UI.createView({
       			backgroundColor : 'pink',
       			height : 40
       		});
       		pinkHeader.add(label);
       
       		data[c] = Ti.UI.createTableViewSection({
       			headerView : pinkHeader
       		});
       		for (var x = 0; x < 10; x++) {
       			data[c].add(Ti.UI.createTableViewRow({
       				title : 'Group ' + (c + 1) + ', Row ' + (x + 1)
       			}));
       		}
       	}
       
       	tableView.data = data;
       
       	var b2 = Ti.UI.createButton({
       		title : 'Close win2',
       		backgroundColor : 'orange',
       		width : 160,
       		height : 80,
       		top: 0
       	});
       	
       	b2.addEventListener('click', function(){
       		win2.close();
       	});
       
       	win2.add(b2);
       	win2.add(tableView);
       	win2.open();
       });
       
       win1.add(b1);
       win1.open();
       
  3. jithinpv 2013-03-13

    Issue reproduces with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 (03/11/13 15:43 0c88429) Titanium SDK version: 3.0.2 (02/07/13 16:46 a4def81) Device: Samsung galaxy s duos Android version: 4.0.4 Android Emulator: Android SDK version: 2.2
  4. Biju pm 2013-06-04

    Added a null value checking. https://github.com/appcelerator/titanium_mobile/pull/4353
  5. Allen Yeung 2013-06-20

    https://github.com/appcelerator/titanium_mobile/pull/3607 Failed FR and was closed due to inactivity.
  6. Hieu Pham 2013-11-13

    Tested with latest master. Unable to reproduce this issue. Closing.
  7. Paras Mishra 2014-07-17

    Issue is not reproducible, hence closing the issue. Tested on: Device : Google Nexus 7, Android Version: 4.4.4 SDK: 3.3.0.v20140711123603 CLI version : 3.3.0-rc4 OS : MAC OSX 10.9.2 Alloy: 1.4.0-rc5 ACS: 1.0.15 npm:1.3.2 LiveView: 1.0.4 Appcelerator Studio, build: 3.3.0.201407111535 titanium-code-processor: 1.1.1 XCode : 5.1.1

JSON Source