Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7240] Android: OptionDialog can't be called several times after a tabgroup is opened and closed.

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-02-14T23:29:02.000+0000
Affected Version/sRelease 1.8.0.1
Fix Version/sSprint 2012-03, Release 2.0.0, Release 1.8.2
ComponentsAndroid
Labelsmodule_optiondialog, qe-testadded, regression
ReporterMauro Parra-Miranda
AssigneeHieu Pham
Created2012-01-16T16:39:36.000+0000
Updated2012-02-14T23:29:02.000+0000

Description

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

Comments

  1. Hieu Pham 2012-02-07

    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.
  2. Hieu Pham 2012-02-07

    New PR https://github.com/appcelerator/titanium_mobile/pull/1369
  3. Dustin Hyde 2012-02-07

    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
  4. Neeraj Gupta 2012-02-07

    Reopening based on Hieu's latest comments.
  5. Opie Cyrus 2012-02-07

    crash occurred during testing after opening and closing the dialog and window roughly 3-6 times. Repeatable. Crash log: http://pastie.org/3338185
  6. Thomas Huelbert 2012-02-13

    see test comments from Opie.
  7. Dustin Hyde 2012-02-13

JSON Source