Hello, I have made an app showing the Corona SDK Documentation using a webView. There is one little problem though, and it is a bit strange, when I implemented the Android’s physical back button to have the webView go back one step in history, it is not doing that, it is doing it twice. I can’t seem to figure this out, help would be appreciated!
-- Called when a key event has been received. local function onKeyEvent( event ) -- Print which key was pressed down/up to the log. local message = "Key '" .. event.keyName .. "' was pressed " .. event.phase print( message ) -- If the "back" key was pressed on Android, then prevent it from backing out of your app. if (event.keyName == "back") and (system.getInfo("platformName") == "Android") then webView:back() return true end -- Return false to indicate that this app is \*not\* overriding the received key. -- This lets the operating system execute its default handling of this key. return false end -- Add the key event listener. Runtime:addEventListener( "key", onKeyEvent );
If you would like to see this issue for yourself you can get the app on Google Play by CLICKING HERE