title: Custom ListView with RadioButton single choice
body: <p>I hope that some of you can help me with this:</p>
  
  <p>I got a custom listview with
  2 textviews and 1 radio button.</p>
  
  <p><strong>I want to make it as a single choice, but everytime I
  click on a item on the listview, it doesn't remove the
  "check" from the other radio button.</strong></p>
  
  <p>My xml code:</p>
  
  <pre><code>&lt;LinearLayout
      android:layout_width="wrap_content"
      android:layout_height="wrap_content" &gt;
  
      &lt;LinearLayout
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:orientation="vertical" &gt;
  
          &lt;TextView
              android:id="@+id/tvMaterialName"
              android:layout_width="250dp"
              android:layout_height="fill_parent"
              android:padding="5dp"
              android:text="MaterialName"
              android:textSize="35px" /&gt;
  
          &lt;TextView
              android:id="@+id/tvMaterialNo"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:padding="5dp"
              android:text="MaterialNo"
              android:textSize="1px"
              android:visibility="invisible" /&gt;
      &lt;/LinearLayout&gt;
  
      &lt;RadioButton
          android:id="@+id/rdBtn"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:focusable="false"
          android:checked="false" /&gt;
  &lt;/LinearLayout
  </code></pre>
  
  <p>And my onItemClickListener:</p>
  
  <pre><code>searchList.setOnItemClickListener(new OnItemClickListener() {
  
          @Override
          public void onItemClick(AdapterView&lt;?&gt; parent, View v,
                  int position, long id) {
  
              LinearLayout item_view = (LinearLayout) v;
              RadioButton itemcheck = (RadioButton) item_view
                      .findViewById(R.id.rdBtn);
  
              itemcheck.setChecked(true);
              if (itemcheck.isChecked()) {
                  itemcheck.setChecked(true);
              } else {
                  itemcheck.setChecked(false);
              }
             }
  
      });
  </code></pre>
  
  <p>My getView() in my adapter</p>
  
  <pre><code>@Override
  public View getView(final int position, View convertView, ViewGroup parent) {
      final ViewHolder viewHolder;
      final Materials materialItem = getItem(position);
      parent.setClickable(true);
  
      LayoutInflater inflater = (LayoutInflater) context
              .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      if (convertView == null) {
  
          convertView = inflater.inflate(R.layout.d, null, false);
          viewHolder = new ViewHolder();
          viewHolder.tvMaterialName = (TextView) convertView
                  .findViewById(R.id.tvMaterialName);
          viewHolder.tvMaterialNo = (TextView) convertView
                  .findViewById(R.id.tvMaterialNo);
  
          convertView.setTag(viewHolder);
  
      } else {
          viewHolder = (ViewHolder) convertView.getTag();
  
      }
  
      viewHolder.tvMaterialName.setText(materialItem.getMaterialName());
      viewHolder.tvMaterialNo.setText(materialItem.getMaterialNo());
  
      return convertView;
  </code></pre>
  
  <p>Thanks for the help</p>