How to remove focus from RecyclerView inside ScrollView?

That is because RecyclerView ALWAYS set:

setFocusableInTouchMode(true);

this is hard coded in its constructor.

so if you apply those attribute in your XML for a RecyclerView

android:focusable="false"
android:focudeableInTouchMode="false"

that would be useless, you end up with recycleView.isFocusable() == true...

so the most elegant solution is to disable foucusable for RecyclerView's Parent.

<LinearLayout
    android:focusable="false"
    android:focusableInTouchMode="false"
    android:descendantFocusability="blocksDescendants"
    ...
    >
    <android.support.v7.widget.RecyclerView
        ...
    />
/>

or you can just simply setFocusable(false)


This problem because of recyclerView has default focus.

Solution

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:descendantFocusability="blocksDescendants"
    android:orientation="vertical">

Add android:descendantFocusability="blocksDescendants" to your immediate layout of scrollView