In my createScene I have the following code
local function onKeyEvent(event) local keyName = event.keyName local phase = event.phase local returnValue = false if(keyName == "back" and phase == "up") then local options = { effect = "slideRight", time = 500, } storyboard.gotoScene("start\_menu", options) returnValue = true end return returnValue end Runtime:addEventListener("key", onKeyEvent)
and in my exitScene I have the following code
function scene:exitScene(event) local group = self.view Runtime:removeEventListener("key", onKeyEvent) end
for some reason the exit scene gets called buy the listener never gets removed.