title: How to add horizontal scroll view and a listview in Android
body: <p>I am trying to create a application in that i need to create a list view but on the top of that i want a horizontal listview for multiple data .I am confused how can we do this .please help me in this </p>
  
  <p><strong>MainActivityXML</strong></p>
  
  <pre><code>&lt;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:paddingLeft="@dimen/activity_horizontal_margin"
      android:paddingRight="@dimen/activity_horizontal_margin"
      android:paddingTop="@dimen/activity_vertical_margin"
      android:paddingBottom="@dimen/activity_vertical_margin"
      tools:context=".HomePage"&gt;
  
      &lt;ScrollView
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_marginTop="10dp"
          &gt;
  
          &lt;LinearLayout
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:layout_marginLeft="8dp"
              android:id="@+id/mydata"
              android:orientation="vertical"&gt;
          &lt;/LinearLayout&gt;
  
  &lt;/ScrollView&gt;
  </code></pre>
  
  <p></p>
  
  <p>In the <code>mydata</code> i want to add the dynamic xml layout that is :</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal" &gt;
      &lt;LinearLayout
          android:id="@+id/mainLinearLayout"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_alignParentTop="true"
          android:orientation="horizontal" &gt;
          &lt;ImageView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:src="@mipmap/ic_launcher"
              android:layout_marginTop="5dp"
              android:layout_marginLeft="10dp"/&gt;
  
          &lt;TextView
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginTop="10dp"
              android:layout_marginLeft="10dp"
              android:text="ABC DEF JKL"
              android:textColor="@android:color/black" /&gt;
      &lt;/LinearLayout&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>And in the <code>main_activity.xml</code> i want to add a horizontal listview but  i am not able to do this .</p>
  
  <p><strong>HorizontialListView</strong></p>
  
  <pre><code>&lt;LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#fff"
    &gt;
  
    &lt;com.test.ui.HorizontialListView
      android:id="@+id/listview"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:background="#ddd"
    /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>And this is my <code>horizontalitems</code> </p>
  
  <pre><code> &lt;LinearLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:background="#fff"
      &gt;
  
      &lt;ImageView
          android:id="@+id/image"
          android:layout_width="150dip"
          android:layout_height="150dip"
          android:scaleType="centerCrop"
          android:src="@mipmap/ic_launcher"
          /&gt;
  
      &lt;TextView
          android:id="@+id/title"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:textColor="#000"
          android:gravity="center_horizontal"
          /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>I want to create something like this
  <img src="https://i.stack.imgur.com/wkZzT.png" alt="I want to create like this"></p>
  
  <p>Issuse i am facing is how could the connect all them .Please guide me in this</p>