1

I have layout like this:

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:clickable="true"
    android:focusable="true"
    android:foreground="?selectableItemBackground"
    android:orientation="horizontal">

    <RadioButton
        android:id="@+id/radioButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical" />

    <WebView
        android:id="@+id/webView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical" />
</LinearLayout>

in my RecyclerView and I want to detect click on any part of that layout, not just RadioButton. Problem I have is that I put click listener on the layout itself but it doesn't detect clicks when user clicks on WebView. I have tried making WebView not clickable and not focusable but it still doesn't work.

live-love
  • 48,840
  • 22
  • 240
  • 204
TheKarlo95
  • 1,144
  • 9
  • 17
  • Same problem as https://stackoverflow.com/questions/47533640/linearlayout-onclick-does-not-work-on-click-of-webview-as-a-child – live-love Feb 26 '21 at 00:27

0 Answers0