Android ScrollView (при прокрутке или fling'd) любит устанавливать фокус EditText, когда он является одним из его детей. Это происходит, когда вы прокручиваете и затем отпускаете. Есть ли способ остановить это поведение? Я пробовал почти все, о чем я могу думать, и все, что я читал в StackOverflow. Ничто не сработало для меня. Ниже приведен пример макета, если вы хотите его протестировать. Я отчаянно пытаюсь остановить это немое поведение.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ScrollView
android:id="@+id/scrollView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginRight="50dp"
android:focusable="true"
android:focusableInTouchMode="true"
>
<EditText
android:layout_width="fill_parent"
android:layout_height="100dp"
android:text="TestApp 1"
/>
<Button
android:id="@+id/btn"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="TestApp 1"
/>
<Button
android:id="@+id/btn"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="TestApp 1"
/>
<Button
android:id="@+id/btn"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="TestApp 1"
/>
<EditText
android:layout_width="fill_parent"
android:layout_height="100dp"
android:text="Bleh...."
/>
<Button
android:id="@+id/btn"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="TestApp 1"
/>
<EditText
android:layout_width="fill_parent"
android:layout_height="100dp"
android:text="TestApp 1"
/>
<Button
android:id="@+id/btn"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="TestApp 1"
/>
<Button
android:id="@+id/btn"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="MeeEEEEEEEEEEEEE"
/>
<Button
android:id="@+id/btn"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="TestApp 1"
/>
</LinearLayout>
</ScrollView>
</LinearLayout>