hi
target platform: Android
i have 3 kind of pages : X , A , M
in X pages when user tap on Back key the program should end without warning. (works Fine)
in A pages when user tap on Back key the program shoud redirect to p3Main.lua
in M pages when user tap on Back key the program should show an overlay question to ask for exit or not
im using code below , but when i want to redirect from A pages to p3Main.lua the overlay pops up and fade itself befor going to p3Main.lua
not:p3Main.lua is a M type Page
its a global event in main.lua
function onKeyEvent( event ) if (event.keyName == "back") and (platformName == "Android") then if pname=="X" then native.requestExit() elseif pname=="A" then composer.gotoScene ( "p3Main", {effect=defaultEffect, time = defaultTime} ) elseif pname=="M" then options = { isModal = true, effect ="fade", time = 500, } composer.showOverlay( "p9Exit", options ) end return true end --return false end --==end of OnKeyEvent() Runtime:addEventListener( "key", onKeyEvent );
