Dismiss keyboard after resuming from "mail" native.popup

Does your app resume after sending the email?

i.e. Is this happening:

  • call to native.showPopup()
  • app suspends and launches email app
  • email edit…send…
  • app resumes
  • keyboard still present over app
    If so, add this code somewhere (main.lua is a good place) and run it ONCE only. It will run forever after that and always try to ‘close keyboard’ on resume.

local function onSystemEvent ( event ) if( event.name == “applicationResume” ) then native.setKeyboardFocus( nil ) endend Runtime:addEventListener( “system”, onSystemEvent )

Hi Ed,

I have this problem too. I tried your code in Main but that didn’t make any difference. I then put it in the scene adding the Listener in “scene:create” and that didn’t fix it either. You say run it ONCE… I assume that you mean put “onSystemEvent()” after adding the Runtime? Anyway, I tried that but it didn’t fix it either so I’m a bit stuck. The App is on Google App store if you want to see what I mean. https://play.google.com/store/apps/details?id=com.gmail.hoyle.gl.LEDbusScreenDesigner

This is an editor for bus destination screens. I felt the best “output” option was to email the code snippet to yourself with native.popup. The keyboard stays on the screen afterwards though until you press the device back key.

Any further ideas?