Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6859] Android: UI - optionDialog click event fired and index contains strange value when back button pressed

GitHub Issuen/a
TypeBug
PriorityTrivial
StatusClosed
ResolutionInvalid
Resolution Date2017-07-12T22:15:14.000+0000
Affected Version/sRelease 1.8.0.1
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterVinothbabu
AssigneeIngo Muschenetz
Created2011-12-09T02:04:35.000+0000
Updated2017-07-12T22:15:42.000+0000

Description

Problem

When an optionDialog is being displayed, and the hardware back button is pressed, optionDialog's index contains the strange value of -268435457. I feel the event should not be returned.

Test case

* run code below * click on the button so that optionDialog shows * hit the hardware back-button. You'll see that this triggers dialog's click event and displays the index value.
var win = Ti.UI.createWindow({
  fullscreen: true,
  backgroundColor: '#000'
});

var button = Ti.UI.createButton({
  title: 'Open dialog'
});

button.addEventListener('click', function() {

  var dialog = Ti.UI.createOptionDialog({
    options: ['Option 1', 'Option 2', 'Option 3'],
    title: 'Options'
  });

  dialog.addEventListener('click', function(e) {
    Ti.API.info('optionDialog click event!');
    Ti.API.info('optionDialog index value = ' + e.index);
  });

  dialog.show();
});

win.add(button);

win.open();

Results

588                   TiAPI  I  optionDialog click event!
588                   TiAPI  I  optionDialog index value = -268435457

Comments

  1. Ivan Skugor 2011-12-10

  2. Ivan Skugor 2011-12-23

  3. Paul Dowsett 2011-12-23

    Vinothbabu You are fortunate that this ticket is almost identical to Ivan's, because it would not have been accepted otherwise. This is because it contained almost none of the necessary information. Please ensure that you read [JIRA Ticket Checklist](https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report) before raising any more tickets. Now that I have completed the information with the help of Ivan's ticket, I will escalate this ticket to our engineering team. Thank you for your understanding.
  4. Lee Morris 2017-07-12

    Closing ticket due to time passed, lack of progress for a number of years and there are linked issues that have more activity. Please open a new ticket if there are any problems.

JSON Source