Two RecyclerViews in one layout is not working because one is missing in Android
<p>I am developing an Android app. In my app, I want to use two RecyclerViews in one layout. I used LinearLayout to wrap up RecyclerViews because of this Stack Overflow question (<a href="https://stackoverflow.com/questions/30061897/two-recyclerviews-under-each-other-in-one-layout">Two RecyclerViews under each other in one layout</a>).</p>
<p>As you can see the answer says, to use LinearLayout and set RecyclerViews height to wrap_content. I followed it. But when I run only one RecyclerView is appear and one is missing.</p>
<p>This is the screenshot:</p>
<p><a href="https://i.stack.imgur.com/VVasK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VVasK.png" alt="enter image description here" /></a></p>
<p>As you can see, only on RecyclerView is appeared.</p>
<p>This is my XML layout:</p>
<pre><code>&lt;LinearLayout
        android:orientation=&quot;vertical&quot;
         app:layout_behavior=&quot;@string/appbar_scrolling_view_behavior&quot;
         android:layout_width=&quot;match_parent&quot;
         android:layout_height=&quot;match_parent&quot;&gt;
         &lt;android.support.v7.widget.RecyclerView
             android:scrollbars=&quot;vertical&quot;
             android:id=&quot;@+id/ai_rc_reviews&quot;
             android:layout_width=&quot;match_parent&quot;
             android:layout_height=&quot;wrap_content&quot;&gt;&lt;/android.support.v7.widget.RecyclerView&gt;
        &lt;android.support.v7.widget.RecyclerView
            android:scrollbars=&quot;vertical&quot;
            android:id=&quot;@+id/ai_rc_reviews_2&quot;
            android:layout_width=&quot;match_parent&quot;
            android:layout_height=&quot;wrap_content&quot;&gt;&lt;/android.support.v7.widget.RecyclerView&gt;
     &lt;/LinearLayout&gt;
</code></pre>
<p>I tried this as well. Nothing appears on screen:</p>
<pre><code>&lt;ScrollView xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
    android:layout_width=&quot;fill_parent&quot;
    android:layout_height=&quot;wrap_content&quot;
    android:fillViewport=&quot;true&quot;&gt;

    &lt;LinearLayout
        android:layout_width=&quot;match_parent&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:orientation=&quot;vertical&quot; &gt;

        &lt;android.support.v7.widget.RecyclerView
            android:id=&quot;@+id/ai_rc_reviews&quot;
            android:layout_width=&quot;match_parent&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:layout_marginBottom=&quot;5dp&quot;
            android:background=&quot;@color/white&quot;/&gt;


        &lt;android.support.v7.widget.RecyclerView
            android:id=&quot;@+id/ai_rc_reviews_2&quot;
            android:layout_width=&quot;match_parent&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:background=&quot;@color/white&quot;/&gt;
    &lt;/LinearLayout&gt;
&lt;/ScrollView&gt;
</code></pre>
<p>How can I fix my code to use two RecyclerViews in single layout. Is there any better way to do it?</p>