Hello everyone,
I tried using the back key on android to navigate to the previous screen. Its working fine except only when the soft keyboard is present. When the soft keyboard is present and I pressed the back button it first hides the soft keyboard, and when the back key is pressed again the app closes. Does anyone experience this?
Here are some of my codes.
[lua]
local function gotoBack()
storyboard.gotoScene( “home”, “slideRight”, 200 )
end
local function onKeyEvent( event )
local phase = event.phase
local keyName = event.keyName
if(phase == “down” and keyName == “back”) then
gotoBack()
end
return true
end
Runtime:addEventListener( “key”, onKeyEvent )
[/lua]