[TIMOB-1827] Android: window close event firing multiple times
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-03-11T22:20:25.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.6.0 M03, Sprint 2012-02, Release 2.0.0, Release 1.8.1 |
Components | Android |
Labels | parity, qe-testadded, release-1.6.0 |
Reporter | Bill Dawson |
Assignee | Hieu Pham |
Created | 2011-04-15T03:03:15.000+0000 |
Updated | 2013-12-10T06:18:54.000+0000 |
Description
In this simple example, if you click the close button in the second window the close event listener runs FOUR times:
/*global Ti, Titanium, alert */
Titanium.UI.setBackgroundColor('#000');
var win1 = Titanium.UI.createWindow({ title:'Test', backgroundColor:'#fff', fullscreen: true, exitOnClose: true });
var win2 = Ti.UI.createWindow({title:'window 2', fullscreen:true, backgroundColor: 'green'});
win2.addEventListener('close',function(){Ti.API.info('CLOSE');});
var open = Ti.UI.createButton({title: 'open'});
open.addEventListener('click', function(){win2.open();});
win1.add(open);
var close = Ti.UI.createButton({title: 'close'});
close.addEventListener('click', function(){win2.close();});
win2.add(close);
win1.open();
Note: if you click the back button instead of clicking the close button, it fires only once.
Attachments
File | Date | Size |
---|---|---|
closetest.zip | 2011-04-15T03:03:15.000+0000 | 772036 |