Hiding keyboard

HI everyone,

The keyboard is constantly popping up during my game, specifically when going from a screen with text fields to a screen without textfields.

I tried using native.setKeyboardFocus(nil) but it is having no effect.

Is there a special place in which i need to put this in my code, or any kind of trick to this? Does it need to be at a spot where my code stops executing, or beginning of execution?
thanks,

Amanda [import]uid: 29997 topic_id: 22363 reply_id: 322363[/import]

This should work. Can you post up some code? [import]uid: 84637 topic_id: 22363 reply_id: 89176[/import]

Thanks for your response.

This function is long…so i’m going to comment some stuff out…

this is a listener function that is called when going from “pointsPage” to 1 of three different pages, decided by the event.target.id. The “show” functions set the group.isVisible=true.

On my devices, when the pages are displayed, they ALWAYS have a keyboard pop up. As you can see, i set the keyboard focus=nil at the end of this listener function, so theoretically, the keyboard should not be showing.

[lua]function buyThings(event)
local b=http.request(“url.com”,“method=buying.person&auth_token=”…token)
local x=parseXML.collect(b)
local answer=x[2][2][1]
x,b=nil,nil
local t={}
for token in string.gmatch(answer,"[^%s]+") do
t[#t+1]=token
end
answer=nil
hidePointsPage()
if event.target.id==“buyLogin” then
if buyLoginGroup.pt==nil then
–add display objects
end
showBuyLogin()
elseif event.target.id==“buyWelcome” then
if buyWelcomeGroup.pt==nil then–haven’t displayed yet:
–add display objects
end
showBuyWelcome()
elseif event.target.id==“buyTips” then
showBuyTips()
else
showPointsPage()
end

t=nil
native.setKeyboardFocus(nil)
end[/lua] [import]uid: 29997 topic_id: 22363 reply_id: 90596[/import]