1

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

why is that?

how can I avoid this?

Elad Benda
  • 32,996
  • 80
  • 259
  • 444

4 Answers4

4

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

    <activity
        android:name="Your_Activity"
        android:windowSoftInputMode="stateAlwaysHidden" >
    </activity>
Rethinavel
  • 3,842
  • 6
  • 27
  • 48
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
  • 3,996
  • 2
  • 27
  • 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,752
  • 2
  • 27
  • 33
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,033
  • 11
  • 33