1

I am new to Android so please bear with me.

I have the following layout which holds the underlying structure:

<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".PicksheetActivity">

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/recyclerView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>

</RelativeLayout>

Followed by the list layout, which would details each list item:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/rootView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <androidx.cardview.widget.CardView
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >


        <ImageView
            android:layout_width="match_parent"
            android:layout_height="180dp"
            android:layout_centerHorizontal="true"
            app:srcCompat="@drawable/field_background" />

        <ImageView
            android:layout_width="160dp"
            android:layout_height="150dp"
            android:layout_gravity="top|left"
            app:srcCompat="@drawable/forty" />

        <ImageView
            android:layout_width="160dp"
            android:layout_height="150dp"
            android:layout_gravity="top|right"
            app:srcCompat="@drawable/hundred" />

    </androidx.cardview.widget.CardView>

</FrameLayout>

I am unsure how I reference the list view layout (second layout)?

Learn2Code
  • 1,974
  • 5
  • 24
  • 46
  • 1
    See this answer [Simple Android RecyclerView example](https://stackoverflow.com/questions/40584424/simple-android-recyclerview-example) – Anand Jun 09 '21 at 01:26
  • 1
    You can do it by using Layout Inflater inside onCreateViewHolder of your recyclerView's Adapter – Jeevandeep Saini Jun 09 '21 at 01:45

0 Answers0