Dialog boxes don't fire on Android

I found a new problem with Android - my dialog boxes don’t fire the function. Ex. My back button gives a dialog box with two options - Ok and Cancel. With Ok it should go back to the main screen but it does not seem to fire the ‘OnBackComplete’ function. Cancel is ok (it just dismisses the dialog box). Note this code works fine on iOS (app on App Store) just not on Android.

[code]
– Handler that gets notified when the alert closes
local function onBackComplete( event )
if “clicked” == event.action then
local i = event.index
if 1 == i then
disableGameView()
media.stopSound()
elseif 2 == i then
– do nothing
end
end
end

function backButton:tap( event )
media.playEventSound(“buttonclick.wav”)
local alert = native.showAlert( “Are you sure you want to leave the game?”, “”, { “OK”, “Cancel” }, onBackComplete )
end

backButton:addEventListener( “tap”, backButton)
[/code] [import]uid: 10652 topic_id: 6605 reply_id: 306605[/import]

This is a known issue on Android (internal case #1620) that hopefully will be addressed soon.

Tim [import]uid: 8196 topic_id: 6605 reply_id: 23075[/import]

I had this problem earlier, and instead of positive indexes for the buttons, they actually return negative indexes so in my code I just had if (i == 1 or i == -1) then, and it worked for me, but your mileage may vary. I had a secondary alert that popped up showing the returned index (to help me figure out the returned index), since there’s no real way of debugging. [import]uid: 8782 topic_id: 6605 reply_id: 23079[/import]