How to hide softkeyboad when activity start in android?

前端 未结 2 1502
礼貌的吻别
礼貌的吻别 2021-01-31 03:03

I have android app in which one layout contains Linearlayout, ScrollView, TextView, EditView and Button. when I

相关标签:
2条回答
  • 2021-01-31 03:52

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

    android:focusable="true"
    android:focusableInTouchMode="true"
    
    0 讨论(0)
  • 2021-01-31 03:55

    In your AndroidManifest.xml:

    <activity android: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.

    0 讨论(0)
提交回复
热议问题