-1

When I go on a view, the keyboard open automaticaly on the first editText and my view is on a scrollView.

My editText:

 <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:inputType="textPersonName"
            android:hint="@string/nom"
            android:ems="25"
            android:id="@+id/etNom"
            android:textSize="20sp"
            android:layout_marginTop="10dp"
            android:layout_marginLeft="5dp"
            android:layout_marginRight="5dp"
            android:layout_marginBottom="5dp"
            android:background="@drawable/edit_text_custom"
            android:padding="5dp"/>
  • see : http://stackoverflow.com/questions/1109022/close-hide-the-android-soft-keyboard –  Jun 28 '16 at 15:47

2 Answers2

0

Put this on your manifest:

android:windowSoftInputMode="stateAlwaysHidden"

to prevent opening at start. You can also request focus from other view, if wanted.

Hope it helps!

Fidel Montesino
  • 337
  • 3
  • 7
0

The answer: I put this on my LinearLayout:

android:descendantFocusability="beforeDescendants"
android:focusableInTouchMode="true"