I have a LinearLayout
which needs to be clickable inside a NestedScrollView
inside a CoordinatorLayout
and almost all the time the first time I click it it simply doesn't work, I must click it another time.
Clickable LinearLayout
:
<LinearLayout
android:id="@+id/qr_code_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:clickable="true"
android:focusable="true"
android:background="?android:attr/selectableItemBackground"
tools:ignore="UseCompoundDrawables">
EDIT: Okay this is very weird, if I wait some seconds before trying to click the View, it works the first time. It only fails if I click it just after scrolling to the bottom.