Add radioButton in ListView
<p>I need to add RadioButton in ListView and indeed I have tried, But the problem that I am getting is that when I click on radio button it get selected wonderfully... but the same time if wish not to select that particular button... it just remains selected. Here I am providing my code:</p>

<pre><code>import android.app.ListActivity;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;

public class RadioInCustomListView extends ListActivity {

    ListView lv;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);


        String[] names = new String[] { "Issues", "Request for Information",
                    "Contracts", "Purchase Orders", "Change Orders", "Proposals",
                    "Submittals" };
            lv = getListView();
            lv.setCacheColorHint(Color.TRANSPARENT);
            ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this, R.layout.radio_item, names);
            //this.setListAdapter (new ArrayAdapter&lt;String&gt;(RadioInCustomListView.this,R.layout.radio_item, names));
            setListAdapter(adapter);
    }

        protected void onListItemClick(ListView l, View v, int position, long id) {
            super.onListItemClick(l, v, position, id);
            Object o = this.getListAdapter().getItem(position);
            Toast.makeText(RadioInCustomListView.this, o.toString(), Toast.LENGTH_LONG).show();


            }
    }
</code></pre>

<p>My xmls:
<strong>main.xml:</strong></p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout 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:id="@+android:id/list"
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    /&gt;
&lt;/LinearLayout&gt;
</code></pre>

<p><strong>radio_item.xml</strong></p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;RadioButton xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@android:id/text1"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:textAppearance="?android:attr/textAppearanceLarge"
  android:gravity="center_vertical"
  android:checkMark="?android:attr/listChoiceIndicatorSingle"
  android:paddingLeft="6dip"
  android:paddingRight="6dip"
/&gt;
</code></pre>
