title: Listview adapter with gridview inside linearlayout showing items below eachother instead of in two columns
body: <p>I'm creating a ListView custom adapter using a gridview inside a linear layout to display user profiles.</p>
  
  <p>My XML design view shows them correctly. However, when I run the app, it's showing each item below each other instead of spread over 2 columns.
  Any idea on what I'm doing wrong?</p>
  
  <p><a href="https://i.stack.imgur.com/xxeoc.png" rel="nofollow noreferrer">Example</a></p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:orientation="vertical" android:layout_width="fill_parent"
      android:layout_height="fill_parent"&gt;
  
      &lt;GridView
          android:id="@+id/grid_view"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:numColumns="2"
          android:stretchMode="columnWidth"
          android:gravity="center" /&gt;
  
      &lt;ImageView
          android:id="@+id/rimage"
          android:layout_width="150dp"
          android:layout_height="150dp"
          android:layout_margin="10dp"
          android:contentDescription="@string/todo"
          app:srcCompat="@drawable/thumb_default_icon_female" /&gt;
  
      &lt;TextView
          android:id="@+id/rnick"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginStart="10dp"
          android:text="@string/nick" /&gt;
  
      &lt;TextView
          android:id="@+id/rcity"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_marginStart="10dp"
          android:text="@string/city" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Showing
  <a href="https://i.stack.imgur.com/pzN5B.png" rel="nofollow noreferrer">List Items</a></p>