title: How do I make a relative layout an item of my ListView? And detect gestures over my ListView?
body: <p>I am trying to make a ListView that has relative layout items, one after another. Each relative layout consists of a Button view, followed by three TextViews aligned to the right of the Button, and below each other. My RelativeLayout XML code is as follows, and it is fine, but how do I make it so that I can populate my ListView with this template after a button press, and how can I manipulate the text inside the textviews so that they say different things for each relative layout item?</p>
  
  <pre><code>&lt;RelativeLayout
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"&gt;
              &lt;Button
                  android:id="@+id/buttonA"
                  android:layout_width="100sp"
                  android:layout_height="100sp"
                  android:layout_marginBottom="8dp"
                  android:layout_marginLeft="8dp"
                  android:layout_marginRight="8dp"
                  android:gravity="center_vertical"
                  android:text="SomeText"
                  android:textColor="#fff"
                  android:onClick="butt"/&gt;
              &lt;TextView
                  android:id="@+id/name"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="Name:"
                  android:textSize="30sp"
                  android:textColor="#000000"
                  android:layout_toRightOf="@+id/buttonA"/&gt;
              &lt;TextView
                  android:id="@+id/date"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="Date:"
                  android:textSize="30sp"
                  android:textColor="#000000"
                  android:layout_toRightOf="@+id/buttonA"
                  android:layout_below="@+id/name"/&gt;
              &lt;TextView
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="Duration:"
                  android:textSize="30sp"
                  android:textColor="#000000"
                  android:layout_toRightOf="@+id/buttonA"
                  android:layout_below="@+id/date"/&gt;
          &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Thanks for the help</p>
  
  <p>Edit: Someone has asked me to share how I am trying to implement this. Honestly, thats the part I'm entirely confused about. I'm new to java and programming in general. I've looked over the documentation here </p>
  
  <p><a href="http://developer.android.com/reference/android/widget/ListView.html" rel="nofollow">http://developer.android.com/reference/android/widget/ListView.html</a></p>
  
  <p>here is where I am trying to add an item into the listview</p>
  
  <pre><code>public void startStop(View view){
      Button ssButton = (Button) findViewById(R.id.ssbutton);
      if(startStopTracker == 0){
          ssButton.setText("STOP");
          ssButton.setBackgroundColor(Color.parseColor("#F44336"));
          startStopTracker = 1;
          enableSwipe = false;
          return;
      }
      if(startStopTracker == 1){
          ssButton.setText("START");
          ssButton.setBackgroundColor(Color.parseColor("#0D47A1"));
          startStopTracker = 0;
          enableSwipe = true;
  
          convoLV.addView(convoButtons[0]);
  
  
          return;
      }
  }
  </code></pre>
  
  <p>where convoLV is the listview and convoButtons is supposed to be an array of relative layouts.</p>
  
  <p>EDIT 2:
  I implemented a version of Nolly's code with a change in the getListItemData() method so that only one item is adde  to the list each time. I also initialized the List listViewItems globally in the activity so that each item would add on. It seems so far to be what I am looking for. However; I am running into an issue where my activity can't detect gestures over the area of my ListView. This is an issue because I use the GestureDetector.onGestureListener.onFling() method to switch between displaying layouts. How can I detect gestures over my ListView?</p>