Hide Samsung Tablet Soft Keyboard Programatically

Android keyboard usually will show up when there are focus in input widget like EditText. In mobile device we can avoid soft keyboard show up when at first fragment/activity start by defining this code on the input widget xml.

android:focusableInTouchMode="true"

But this method will not work in samsung tablet, in my case Samsung Galaxy Tab.
So we have to hide it programatically to hide samsung soft keyboard. We just need to add this single line on your fragment/activity initialization.

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

Reference: http://stackoverflow.com/a/10699765/1936697

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s