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
Label: corona android iphone ipad building error inmobi problem display screen View image tableView failed object physics touch button game lua config event listener |
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
there was a topic about back button api, search it on forums
Hi,
Something like :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | -- 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 ) |
Thanks for pointing the way Phil, much appreciated