Problem Description
Ti.UI.OptionDialog can be called multiple times in SDK 1.8 without problems, but not after a TabGroup is opened and then closed. Happening on both v8 and rhino.
Steps to reproduce
1. Add this code to a new mobile project
var w = Ti.UI.createWindow({
backgroundColor: 'red',
fullscreen: false,
exitOnClose: true
});
var b = Ti.UI.createButton({
height: 50,
title: 'click'
});
b.addEventListener('click', function(e) {
var optDlg = Ti.UI.createOptionDialog({
title: 'choose',
options: ['open', 'dismiss']
});
optDlg.addEventListener('click', function(e) {
if (e.index===0) {
var t = Ti.UI.createTabGroup(),
w1 = Ti.UI.createWindow({
title: 'blue',
backgroundColor: 'blue'
}),
b1 = Ti.UI.createButton({
title: 'close'
}),
t1 = Ti.UI.createTab({
title: 'blue',
window: w1
});
w1.add(b1);
b1.addEventListener('click', function(e){
t.close();
});
t.addTab(t1);
t.open();
}
});
optDlg.show();
Ti.API.info('must be showing dlg');
});
w.add(b);
w.open();
2. Click the button
3. Select something.
4. Close
5. click open again
ACTUAL RESULTS
The openDialog doesn't open
EXPECTED RESULTS
openDialog should work.
MORE INFO
It's working fine in 1.7.5
Reopen this issue b/c the previous PR for this has a mistake - It didn't remove the tab activity properly when back key is hit.
New PR https://github.com/appcelerator/titanium_mobile/pull/1369
Closing as Fixed. SDK: 1.9.0.v20120207124634 Studio: 1.0.8.201201262211 OS: Lion Devices Tested: Android Emulator 2.2, Xoom 3.2.1
Reopening based on Hieu's latest comments.
crash occurred during testing after opening and closing the dialog and window roughly 3-6 times. Repeatable. Crash log: http://pastie.org/3338185
see test comments from Opie.