1

I have this Layout.
every time it's opened, the android keyboard appears

why is that?

how can I avoid this?

Elad Benda
  • 35,076
  • 87
  • 265
  • 471

4 Answers4

4

Add this to your manifest file, You can avoid that.

    <activity
        android:name="Your_Activity"
        android:windowSoftInputMode="stateAlwaysHidden" >
    </activity>
Rethinavel
  • 3,912
  • 7
  • 28
  • 49
1

If the EditText has requestFocus,then keyboard might display automatically. It has nothing to do with your xml code.

Add the following line to your Manifest File inside each Activity tab

android:windowSoftInputMode="stateAlwaysHidden" 

or add the following to your parent layout in that activity

android:descendantFocusability="beforeDescendants"
android:focusableInTouchMode="true"
krishna
  • 4,069
  • 2
  • 29
  • 56
0

Strange ! I thought Screen which has editText only get focus.

Try this => Stop EditText from gaining focus at Activity startup

Community
  • 1
  • 1
Thein
  • 3,940
  • 2
  • 30
  • 34
0

Android opens the OnScreenKeyboard automatically if you have an EditText focussed .

You can prevent that by adding following into your Activity's onCreate method.

getWindow().setSoftInputMode(
    WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
Pihu
  • 1,041
  • 11
  • 35