Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17633] Android: ListView disappears after activity is recreated

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2014-09-12T18:25:02.000+0000
Affected Version/sn/a
Fix Version/sRelease 3.4.0
ComponentsAndroid
Labels3.5.0, TCSupport, activity, android, listview, module_listview, qe-testadded, regression
ReporterMark Mokryn
AssigneeHieu Pham
Created2014-09-04T18:04:50.000+0000
Updated2014-10-08T22:14:42.000+0000

Description

Try the following on both 3.5.0 and 3.3.0.GA 1. Check "Do not keep activities" in developer options 2. Open and close window 2 3. On 3.5.0 the ListView disappears when we come back from window 2 4. Note that the button does not disappear, so the problem seems specific to listview.
var listView = Ti.UI.createListView();
var sections = [];

var fruitSection = Ti.UI.createListSection({ headerTitle: 'Fruits'});
var data = [];
for (var i = 0; i < 2; i++) {
	data.push({properties: { title: 'row ' + i, color: 'white', font: {fontSize: '15dp'}}});
}
fruitSection.setItems(data);
sections.push(fruitSection);
listView.sections = sections;

var win1 = Ti.UI.createWindow({title : 'TW1',backgroundColor:'blue'});
win1.add(listView);

var win2 = Ti.UI.createWindow({title: 'Window 2'});
 
var openWindowButton = Ti.UI.createButton({title:'Open window2'});
win1.add(openWindowButton);

var closeWindowButton = Ti.UI.createButton({width:Ti.UI.SIZE,height:Ti.UI.SIZE,title:'Close window2'});
win2.add(closeWindowButton);
 
openWindowButton.addEventListener('click',function(e){win2.open();});
closeWindowButton.addEventListener('click',function(e){win2.close();});

win1.open();

Comments

  1. Hieu Pham 2014-09-05

    master PR: https://github.com/appcelerator/titanium_mobile/pull/6023 3.4.X PR: https://github.com/appcelerator/titanium_mobile/pull/6024
  2. Pedro Enrique 2014-09-05

    PR merged
  3. Lokesh Choudhary 2014-09-12

    Verified the fix. The listview does not disappear after win2 is closed. Closing. Environment: Appc Studio : 3.4.0.201409112242 Ti SDK : 3.4.0.v20140912084114 Mac OSX : 10.9.4 Alloy : 1.5.0-rc CLI - 3.4.0-rc2 Code Processor: 1.1.1 Galaxy S4 - Android 4.4.2
  4. Lokesh Choudhary 2014-09-12

    Reopening to add tester.

JSON Source