Note that there are some explanatory texts on larger screens.

plurals
  1. POcheck box on custom listview
    text
    copied!<p><img src="https://i.stack.imgur.com/kQpdi.png" alt="enter image description here"> me getting like this it should not only show on particular item How to make radio buttons in custom listview as single mode. If I click on particular radio button then it has to appear and the other one as unselected. If click on 1st row then radio button on first row selected.click on second row radion button on second row seleceted and first row unselected.click on third row radio button on third row selected and first row and second row unselected. </p> <p><strong>customlist.xml</strong></p> <blockquote> <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" &gt; &lt;RadioButton android:id="@+id/radioButton1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_alignParentLeft="true" android:text="" /&gt; &lt;TextView android:id="@+id/card" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingLeft="10dip" android:layout_centerVertical="true" android:layout_toRightOf="@+id/radioButton1" android:text="" android:textColor="#000000" android:textSize="15dip" android:textStyle="bold" /&gt; &lt;/RelativeLayout&gt; listView = (ListView) findViewById(R.id.cardlist); adapter =new MyAdapter(this, app.arryList,app.arryList1); listView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2, long arg3) { // TODO Auto-generated method stub Toast.makeText(getApplicationContext(), "am thelist",Toast.LENGTH_LONG).show(); } }); listView.setAdapter(adapter); listView.setChoiceMode(listView.CHOICE_MODE_SINGLE); } public class MyAdapter extends BaseAdapter { Context context = null; ArrayList&lt;String&gt; items= null; ArrayList&lt;String&gt; items1= null; public MyAdapter(Newcard newcard, ArrayList&lt;String&gt; items, ArrayList&lt;String&gt; items1) { // TODO Auto-generated constructor stub this.items = items; this.items1 = items1; } @Override public int getCount() { // TODO Auto-generated method stub return items.size(); } @Override public Object getItem(int position) { // TODO Auto-generated method stub return items; //return items.get(position); } @Override public long getItemId(int position) { // TODO Auto-generated method stub return position; } @Override public View getView(final int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub View layout = null; TextView produ = null; TextView desc = null; Button edit = null; RadioButton radio =null; if (convertView == null) { lay = LayoutInflater.from(getApplicationContext()); layout = lay.inflate(R.layout.customlist, null); } else { layout = convertView; } produ = (TextView) layout.findViewById(R.id.card); produ.setText("" +app.arryList.get(position)); radio = (RadioButton) layout.findViewById(R.id.radioButton1); radio.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub //check.setVisibility(View.GONE); System.out.println("data "+app.arryList.get(position)); } }); } }); return layout; </code></pre> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload