title: How to add A TextView Dynamically in the ListView Items Android?
body: <p>I want to add a TextView and Set it's value dynamically in the ListView and On click of the item i want to get the value of the item clicked .</p>
  
  <p>I have a array </p>
  
  <pre><code>String[] statesList = {"listItem 1", "listItem 2", "listItem 3"};
  </code></pre>
  
  <p>My <strong>TextView XML</strong> is </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;TextView xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"  
      android:layout_height="fill_parent"
      android:padding="10dp" 
      android:textSize="16sp" 
      android:textStyle="bold" 
      &gt;
  &lt;/TextView&gt;
  </code></pre>
  
  <p>My <strong>ListView XML</strong> </p>
  
  <pre><code> &lt;ListView
              android:id="@+id/list"
              android:choiceMode="singleChoice"
              android:layout_height="wrap_content"
              android:layout_marginLeft="5dp"
              android:layout_marginTop="10dp"
              android:layout_width="290dp"/&gt;
  </code></pre>
  
  <p>Please help me how could i set those values in the array to the listview .i am new in android.Thanks</p>