I am trying to use hardware back button as back button of app.in my main.lua ,
local storyboard=require(“storyboard”);
Runtime:addEventListener(“key”, function (event)
if(event.keyName == “back” and event.phase == “down”) then
local scene = storyboard.getScene(storyboard.getCurrentSceneName())
return scene:backPressed()
end
end);
in option.lua ,
function scene:backPressed()
storyboard.gotoScene(“start_menu”,{
effect=“crossFade”,
time=250
});
return true
end
it should go back to start_menu page from the option page .
it causes hang and after a while exit from the app .but app’s back button works fine from option.lua. I don’t understand what’s the problem .please help