Dismiss focus on a editText view

asigala

Member
Licensed User
Longtime User
:sign0085: :sign0085: :sign0085:

Hello.

How can I cancel the focus state on a editText?

Thank's in advance.
 

stevel05

Expert
Licensed User
Longtime User
There may be a simpler way, but in the past I've created a dummy edittext which is off screen or permanently hidden behind something else, with it's inputtype set to None so the keyboard doesn't display.

When I want to hide the focus I'll call a sub something like:

B4X:
Sub HideFocus
   HiddenET.Text=""              'In case a keyboard is attached and something has been typed
   HiddenET.RequestFocus
End Sub
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
I couldn't remember exactly how I did it so I recreated it, see attached. The order of edittext on the layout is important.
 

Attachments

  • HideETFocus.zip
    7.2 KB · Views: 288
Last edited:
Upvote 0
Top