The alert shows and dismisses ok, but when another button is touched the alert is back.
What am I doing wrong?
Hopefully some extra eyes can tell me.
Code as below is in file bdlogin.lua which is included in main.lua
A Login button in titlebar in main.lua calls the gotoLogin function in bdlogin.lua.
Works perfectly in simulator.
Works perfectly on device if alert is commented out, I.e. screen change correctly when Login or Back buttons pressed.
With alert in use and on device the alert pops up when changing to loginScreen.
On dismiss (OK touch) the alert dismisses.
Now for the yukk…
When the back button is touched the alert pops back up and the loginScreen redisplays instead of the slide to coffeeListScreen. I.e. it never goes back, just reactivates the alert and re-slides to loginScreen.
Please tell me where I’m screwing up. It’s been driving me nuts as I have similar working on other pages and the sample fish app with alert works.
Of course my normal bdlogin.lua contains more code but I’ve trimmed it down in an effort to find my own mistakes, but have failed 
TIA
[lua]-- bdlogin.lua
– in main.lua
– require(“bdlogin”)
– coffeeListScreen = newScreen( 320, true, “Rare Parts”, “stripes”, false, “redtitlebg.png”, nil, nil, 320, 1024 )
– coffeeListScreen:addRightButton( “Login”, gotoLogin, false, nil, nil, nil, nil, “redbtnleft.png”, “redbtnmid.png”,“redbtnright.png”, “custombtnleft-over.png”, “custombtnmid-over.png”, “custombtnright-over.png” )
– loginScreen = newScreen( 320, true, “Account Login”, “stripes”, true, “redtitlebg.png” )
– loginScreen:addLeftButton( “”, goBackToFirstFromLogin, false, “redbackbtn.png”, “custombackbtn-over.png” )
– *******************************
goBackToFirstFromLogin = function (event )
if event.phase == “release” then
loginScreen:slideToRight( coffeeListScreen )
end
end
gotoLogin = function()
local function onComplete( event )
if “clicked” == event.action then
local i = event.index
if 1 == i then
– Do nothing; dialog will simply dismiss
end
end
end
local alert = native.showAlert( “Corona”, “Alert test”, { “OK” }, onComplete )
coffeeListScreen:slideToLeft( loginScreen )
end[/lua] [import]uid: 6547 topic_id: 10180 reply_id: 310180[/import]