Skip to content Skip to sidebar Skip to footer

How To Hide Softkeyboad When Activity Start In Android?

I have android app in which one layout contains Linearlayout, ScrollView, TextView, EditView and Button. when I call from one activity to other this activity call and set layout wh

Solution 1:

In your AndroidManifest.xml:

<activityandroid:name="com.your.package.ActivityName"android:windowSoftInputMode="stateHidden"  />

More details about windowSoftInputMode can be found here.

This setting will hide soft keyboard when user enters new Activity (even if EditText control gains the focus). Soft keyboard will be shown only when user clicks the edit box control.

Solution 2:

You can hide keyboard by add two lines to the parent view of editText.

android:focusable="true"android:focusableInTouchMode="true"

Post a Comment for "How To Hide Softkeyboad When Activity Start In Android?"