0
リサイクルビューを含む多くの子ビューを持つ線形レイアウトです。 親ビュー全体をクリック可能にして、子供がクリックされたときに同じことが起こりたいと思います。つまり、親ビューでクリックした場所をクリックすると、そのメソッドが呼び出されます。親LinearLayout onclick、子リサイクルビューから呼び出されていない
これはうまくいきました。親をクリックするたびにメソッドが呼び出されます。リサイクラーのビューを除いて、そこをクリックすると何も起こりません。私は、リクリスタルビューのclickableとfocusableをtrueとfalseに設定しようとしましたが、それでも動作しませんでした。ここで
は私のxmlです:<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="onTodayMainPageClick"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="@drawable/date_background"
android:orientation="vertical"
android:padding="10dp">
<TextView
android:id="@+id/date_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/colorPrimary"
android:layout_gravity="center"
android:text="1st October 2017"
android:layout_marginBottom="10dp"/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/colorPrimary"/>
<TextView
android:id="@+id/whats_left_for_today_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:text="Whats left for today"
android:textColor="@color/colorPrimary" />
<android.support.v7.widget.RecyclerView
android:id="@+id/today_recycler_view_summary"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
android:focusable="true"
android:paddingBottom="10dp"
android:paddingLeft="20dp"
android:paddingRight="20dp">
</android.support.v7.widget.RecyclerView>
</LinearLayout>
おかげ
あなたは、以下の方法でそれをやってみてください