Hello guys! Help me please, i’m stuck with hardware android back button, i don’t understand why it’s doesn’t work and tried to find a solution for at least a week
I have three scenes: “listlesson”->“lesson1”->“help1”
And all works fine, expect this “hardware android back button”, - because here begin some strange things:
When i go to “listlesson”->“lesson1” and then push “back button” - it works fine! But when i push it from scene “help1” - my app crashes, in “help1” i use same code as in “lesson1”, i will be very glad if anyone can tell me why it’s happening
Here is a code:
local function onKeyEvent( event ) local phase = event.phase; local keyName = event.keyName; if ( "back" == keyName and phase == "up" ) then storyboard.gotoScene(true, "listLesson" ,"fromLeft", 200) end return true end if system.getInfo( "platformName" ) == "Android" then Runtime:addEventListener( "key", onKeyEvent ) end
All display back button works fine, if anyone have ideas i will be very glad!!! I put two this file in attach
