donderdag 16 juni 2011

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!

Geen opmerkingen:

Een reactie posten