-2

I have at least 2 Activities where there is EditTexts and you can enter/update data.. but on my device I always have to press the back button to get rid of the keyboard that pops up. Is there a way to key rid of it after you have entered your values? If so, at what is the code and where would you put it. Or have it iterate through the fields or something.. I just want it to go away when a user is finished typing.

Chathuranga Chandrasekara
  • 19,150
  • 28
  • 95
  • 135
HighGreenz
  • 3
  • 1
  • 2
  • How would the keyboard know that the user has finished typing? After typing 1 character, you could enter another one or you may not enter anything at all. By pressing back key, you are telling keyboard that you are done with typing and now you don't require it. – gegobyte Nov 28 '14 at 07:02

1 Answers1

5

Well ussually there is this some sort of **OK / GO / Finished ** button implemented already in Android keyboards.

If there is none, try adding this to your XML file:

android:imeOptions="actionDone"

For closing / hidding soft-keyboard, please check following link:

How to Close /Hide Soft Keyboard in Android

Hide it for example when the user clicks your Button.

Hope it helps.

Community
  • 1
  • 1
David Kasabji
  • 1,009
  • 1
  • 15
  • 31