0

I can remove focus from EditText in layout if it is only one field using this:

android:focusable="true"
android:focusableInTouchMode="true"

But if I add more, it keeps focusing on later one.

Michael Yaworski
  • 12,398
  • 17
  • 59
  • 91
Vilius
  • 536
  • 1
  • 5
  • 12

1 Answers1

1

Take out

<requestFocus/>

from each EditText in your XML.

There is also this and possibly that which helped me.

Summary of the links above:

add these properties to your Relative or Linear Layout:

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

So for example:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/mainLayout"
    android:descendantFocusability="beforeDescendants"
    android:focusableInTouchMode="true" >
Community
  • 1
  • 1
Michael Yaworski
  • 12,398
  • 17
  • 59
  • 91