[TIMOB-1767] Android: event listeners in reopened window do not fire.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Trivial |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2011-04-15T03:01:40.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.5.0 |
Components | Android |
Labels | android, defect |
Reporter | Bill Dawson |
Assignee | Bill Dawson |
Created | 2011-04-15T03:01:38.000+0000 |
Updated | 2017-03-02T19:03:23.000+0000 |
Description
app.js:
Ti.UI.setBackgroundColor('#000');
Ti.UI.createWindow({
backgroundColor: 'blue',
url: 'main.js',
fullscreen:true,
exitOnClose: true
}).open();
main.js:
var win = Ti.UI.currentWindow;
var btn = Ti.UI.createButton({
title: 'open subwindow'
});
var win2 = Ti.UI.createWindow({
url: 'sub.js',
fullscreen: true,
backgroundColor: 'red'
});
win2.addEventListener('close', function() {Ti.API.info('window close');});
btn.addEventListener('click', function(){win2.open();});
win.add(btn);
sub.js:
var win = Ti.UI.currentWindow;
var btn = Ti.UI.createButton({title: 'close'});
btn.addEventListener('click', function(){win.close();});
win.add(btn);
The second time you open sub window, the button inside it will not work anymore.
Very likely caused by http://github.com/appcelerator/titanium_mobile/commit/026c645a26d0c83587246af2eaf8d6e82ae65179"> this commit, wherein I thought I was limiting to app events -- but perhaps that distinction cannot really be made.
Attachments
File | Date | Size |
---|---|---|
test_files.zip | 2011-04-15T03:01:39.000+0000 | 1218 |