Add a button and check-boxes dynamically to my list view?
<p>I have a list view showing all the names of the contacts in the phone.<br>
I want, on the click of a button, for check boxes to appear in front of each row in the list view. Tap any single item of a list view once, and a delete button should appear in front of that respective row.</p>

<p>Here is my layout file:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;RelativeLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"&gt;
    &lt;ListView android:layout_height="350dp" android:id="@android:id/list" android:layout_width="fill_parent" android:layout_alignParentTop="true" android:layout_alignParentLeft="true" android:layout_marginTop="35dp"&gt;

    &lt;/ListView&gt;

    &lt;Button android:id="@+id/button1" android:layout_height="35dp" android:text="Button" android:layout_width="70dp" android:layout_alignParentTop="true" android:layout_alignParentLeft="true"&gt;&lt;/Button&gt;

    &lt;TextView android:id="@+id/textView1" android:textAppearance="?android:attr/textAppearanceMedium" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="Favourites" android:layout_alignParentRight="true" android:layout_toRightOf="@+id/button1" android:layout_alignBottom="@+id/button1" android:layout_alignParentTop="true" android:gravity="center"&gt;&lt;/TextView&gt;

&lt;/RelativeLayout&gt;
</code></pre>

<p><br>
I get my text view from this file:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
 &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="?android:attr/listPreferredItemHeight"
    android:padding="6dip"&gt;

    &lt;RelativeLayout
        android:orientation="vertical"
        android:layout_width="0dip"
        android:layout_weight="0.96" android:layout_height="73dp"&gt;
        &lt;TextView
            android:id="@+id/textView_name"
            android:layout_height="0dip"
            android:gravity="center_vertical"
        android:layout_weight="1" android:layout_width="218dp"/&gt;

    &lt;/RelativeLayout&gt;
&lt;/LinearLayout&gt;  
</code></pre>
