Hide/Disable soft keyboard on Activity launch: Android

By default, Android will automatically assign initial focus to the EditText or focusable control in started activity . It naturally follows that the InputMethod (typically the soft keyboard) will respond to the focus event by showing itself.
 

To hide Keyboard we can do any of below way

add in Activity oncreate method before setContentView() method

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

 

or add below code  Manifest file to which activity we need to hide keyboard

<activity
    android:name=".MyActivity"
    android:windowSoftInputMode="stateAlwaysHidden"/>

 


Subscribe For Daily Updates

Flutter Questions
Android Questions