How to disable keypad popup when on edittext?

The best solution lies in the Project Manifest file (AndroidManifest.xml), add the following attribute in the activity construct

android:windowSoftInputMode=”stateHidden”


Example:

    <activity android:name=".MainActivity" 
              android:windowSoftInputMode="stateHidden" />

Description:

  • The state of the soft keyboard — whether it is hidden or visible — when the activity becomes the focus of user attention.
  • The adjustment made to the activity’s main window — whether it is resized smaller to make room for the soft keyboard or whether its contents pan to make the current focus visible when part of the window is covered by the soft keyboard.

Introduced in:

  • API Level 3.

Link to the Docs

Note:
Values set here (other than “stateUnspecified” and “adjustUnspecified”) override values set in the theme.

Leave a Comment