exiting an application gracefully

Hi there…

I want my application to have a dialog box that pops up if the ‘back’ button is pressed… how do I capture the back button event? Because at the moment as soon as the user presses the back button, my application closes down…
Thanks [import]uid: 67619 topic_id: 15686 reply_id: 315686[/import]

there was a topic about back button api, search it on forums [import]uid: 16142 topic_id: 15686 reply_id: 57890[/import]

Hi,
Something like :
[lua] – Key listener
local function onKeyEvent( event )
local phase = event.phase
local keyName = event.keyName
if ( keyName == “back”) then
onQuitButton() – where you pop-up the dialog
return true
else
return false
end
end

– Add the key callback
Runtime:addEventListener( “key”, onKeyEvent )[/lua]

should do the trick.

__
Phil [import]uid: 51301 topic_id: 15686 reply_id: 57925[/import]

Thanks for pointing the way Phil, much appreciated [import]uid: 67619 topic_id: 15686 reply_id: 58288[/import]