Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17985] Android: showTimePickerDialog method does not work.

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionInvalid
Resolution Date2014-11-06T15:08:19.000+0000
Affected Version/sRelease 3.4.0
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterMotiur Rahman
AssigneeIngo Muschenetz
Created2014-11-06T05:38:08.000+0000
Updated2017-03-20T21:57:38.000+0000

Description

Description

If I do not add a picker to the window showTimePickerDialog method does not work.

Testing Environment:

Titanium SDK: 3.4.0 Titanium CLI: 3.4.0 Android SDK :4.2.2, 4.3, 4.4.2 OS X Version: 10.9.5, Appcelerator Studio: 3.4.1

Steps to Reproduce:

1. Create a Classic project. 2. Paste this code in app.js file. 3. Run this code with the testing environment. 4. Click the time button time picker is not shown. 5. Add the picker to the window and click the button time picker is shown. *Test Code*
var win = Ti.UI.createWindow({
	backgroundColor : 'white',
	layout : 'vertical'
});

var timePicker = Ti.UI.createPicker({
	//top : 1000
});

// Create a Button.
var time = Ti.UI.createButton({
	title : 'Time',
	height : 50,
	width : 100,
	top : 20,
});

// Listen for click events.
time.addEventListener('click', function() {
	timePicker.showTimePickerDialog({
		callback : function(e) {
			if (e.cancel) {
				Ti.API.info('User canceled dialog');
			} else {
				Ti.API.info('User selected Time: ' + e.value);
			}
		}
	});

});

win.add(time);
//win.add(timePicker);

win.open();

Thanks.

Comments

  1. Ingo Muschenetz 2014-11-06

    When you create a timePicker, you've not yet added it into the visual hierarchy. You need to add it to the window before showing it. Even if you assume that picker.showTimePickerDialog() should automatically add the picker to some window and show it, which window would it target? We could update the documentation to make this explicitly stated.
  2. Lee Morris 2017-03-20

    Closing ticket as invalid.

JSON Source