Hide keyboard on input selection

When your activities first focus on opening is on an input field (like editText) you will get the android software onscreen keyboard popping up blocking half of the screen for your activity right away. To overcome this use this code:

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

This will prevent the keyboard to popup until the user actually selects that input field. The way it should be!

Leave a Reply

Your email address will not be published. Required fields are marked *

Please reload

Please Wait