Prevent the keyboard from displaying on activity start

Fcoder picture Fcoder · Mar 16, 2012 · Viewed 142.3k times · Source

I have an activity with an Edit Text input. When the activity is initialized, the Android keyboard is shown. How can the keyboard remain hidden until the user focuses the input?

Answer

Lucas picture Lucas · Mar 16, 2012

I think the following may work

getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);

I've used it for this sort of thing before.