Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2378] Android: alert dialog - basic alert - returns unexpected values when dismissing

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-11-05T13:38:48.000+0000
Affected Version/sRelease 1.5.0
Fix Version/sSprint 2011-25, Release 1.7.2, Release 1.8.0
ComponentsAndroid
Labelsregression
ReporterThomas Huelbert
AssigneeBill Dawson
Created2011-04-15T03:18:16.000+0000
Updated2011-11-05T13:38:48.000+0000

Description

1.5.0.fb4b340. G2 (2.2) 2.1 emulator. g1 (1.6)

1.Base UI > Alert
2.Tap Basic Alert button
3.tap back button
4.read values shown

results: -268435457. if you then test a nother one of the alerts, then try this one again, you'll get a value of "1"

previously (1.4.2) no value was returned here.

Comments

  1. Bill Dawson 2011-06-21

    This behavior is actually proper, or at worst "undefined" (and definitely looks odd.) Android basic alerts have no button (unlike iOS, which needs the OK button to get rid of the alert). Therefore when the event occurs, the selected index is undefined (and that weird huge negative number, which is actually -1 &= ~BUTTON_MASK . The action of backing out of the Android basic alert (which has no buttons) is considered a "cancel". And the other tests below the basic one explicitly set the cancel value to 1: a.cancel = 1;. The same instance of the alert dialog is re-used over and over for these tests, so the next time the top test (the basic alert) is called, the value for cancelation will be 1 (because those other tests set it to that.) Thus the 1. It also doesn't make sense (for Android) that the alert message is "One Button", since there is no button.
  2. Don Thorp 2011-06-22

    Reviewed and functional test passed.
  3. Don Thorp 2011-06-23

    merged to 1_7_X
  4. Alan Vaghti 2011-07-08

    As noted, the results are expected. Passed as expected on Nexus One running 2.2.2, Android Emulator running 2.3.3, Galaxy Tab running 2.2.1, and Xoom tablet running 3.1. System used: OSX 10.6.8, TiStudio 1.0.1.201106171427. Passed on both SDK 1.7.2.v20110707155439: version=1.7.2 timestamp=07/07/11 15:54 githash=3d44999... and SDK 1.8.0.v20110708082651 version=1.8.0 timestamp=07/08/11 08:26 githash=3e25122...
  5. Don Thorp 2011-11-05

    Fixing labels.

JSON Source