title: How to create a variable number of textviews in android
body: <p>Hopefully this isn't a bad question, however I've searched through S.O. and haven't been able to find the answer. </p>
  
  <p>I am creating an android application that is essentially an alarm clock. I want the main activity to display all alarms that have been created along with some information about the alarms. My question about this is how to create a given number of text views based on how many alarms have been created. For example if a user has created (and not deleted) 5 alarms, how do I have it display 5 textviews rather than just a hard-coded number of text views? Following is my horribly hard-coded prototype to test the functionality (aside from this hangup).</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"
      tools:context=".Launch" &gt;
  
      &lt;ScrollView
          android:orientation="vertical"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"&gt;
          &lt;LinearLayout android:orientation="vertical" 
                        android:layout_width="fill_parent" 
                        android:layout_height="fill_parent"&gt;
  
              &lt;TextView
                  android:orientation = "vertical"
                  android:layout_width="fill_parent"
                  android:layout_height="75dp"
                  android:text="Time"/&gt;
                      &lt;View
                      android:layout_width="fill_parent"
                      android:layout_height="0.2dp"
                      android:id="@+id/separator"
                      android:visibility="visible"
                      android:background="@android:color/darker_gray"/&gt;
  
              &lt;TextView
                  android:orientation = "vertical"
                  android:layout_width="fill_parent"
                  android:layout_height="75dp"
                  android:text="Time"/&gt;
                      &lt;View
                      android:layout_width="fill_parent"
                      android:layout_height="0.2dp"
                      android:id="@+id/separator"
                      android:visibility="visible"
                      android:background="@android:color/darker_gray"/&gt;
  
              &lt;TextView
                  android:orientation = "vertical"
                  android:layout_width="fill_parent"
                  android:layout_height="75dp"
                  android:text="Time"/&gt;
                      &lt;View
                      android:layout_width="fill_parent"
                      android:layout_height="0.2dp"
                      android:id="@+id/separator"
                      android:visibility="visible"
                      android:background="@android:color/darker_gray"/&gt;
  
  
          &lt;/LinearLayout&gt;
  
      &lt;/ScrollView&gt;
  
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>As you can see, there are just three hard-coded text views rather than a number of text views as created by the user.</p>
  
  <p>Again, I hope this isn't too in depth of a question or one that has an answer posted elsewhere but I searched for it and couldn't find anything. </p>
  
  <p>Thanks in advance!</p>