title: Select only one radio button in RecyclerView
body: <p>I am new in android development. How can I select only one radio button from <code>RecyclerView</code>.
  I have one <code>RecyclerView</code> and cartview layout which is single item for <code>RecyclerView</code>. I have one radio button in cart layout. I want to select only single radio button in recylerview. How can I achive this.</p>
  
  <p>Here is my adapter code</p>
  
  <pre><code> public class CardviewAdapterDateTimeLocation extends RecyclerView.Adapter&lt;CardviewAdapterDateTimeLocation.ViewHolder&gt;  {
  
   private Context mContext;
   public int lastCheckedPosition = 2;
  
   private static ArrayList&lt;AdressAcivity_cardview_getter_setter&gt; dataSet;
   public CardviewAdapterDateTimeLocation(ArrayList&lt;AdressAcivity_cardview_getter_setter&gt; os_versions) {
  
          dataSet = os_versions;
      }
  
      @Override
      public CardviewAdapterDateTimeLocation.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
  
          final View itemLayoutView = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.cardview_datetimelocation_activity, null);
          CardviewAdapterDateTimeLocation.ViewHolder viewHolder = new CardviewAdapterDateTimeLocation.ViewHolder(itemLayoutView);
  
          return viewHolder;
      }
  
      @Override
      public void onBindViewHolder(final CardviewAdapterDateTimeLocation.ViewHolder viewHolder, final int i) {
  
          AdressAcivity_cardview_getter_setter fp = dataSet.get(i);
          viewHolder.addressline1.setText(fp.getAddressline1());
          viewHolder.addressline2.setText(fp.getAddressline2());
          viewHolder.addressline3.setText(fp.getAddressline3());
  
          viewHolder.mRemoveButton.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                  String itemLabel = dataSet.get(i).toString();
                  dataSet.remove(i);
                  notifyItemRemoved(i);
                  notifyItemRangeChanged(i,dataSet.size());
              }
          });
          viewHolder.editbtn.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
  
              }
  
          });
          viewHolder.selectaddress.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
              @Override
              public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
              }
          });
          viewHolder.feed = fp;
      }
  
      @Override
      public int getItemCount() {
          return dataSet.size();
      }
  
      public static class ViewHolder extends RecyclerView.ViewHolder {
  
          public TextView addressline1;
          public TextView addressline2;
          public TextView addressline3;
          public ImageView mRemoveButton,editbtn;
          public static RadioButton selectaddress;
          public AdressAcivity_cardview_getter_setter feed;
  
          public ViewHolder(View itemLayoutView) {
              super(itemLayoutView);
  
              addressline1=   (TextView)itemLayoutView.findViewById(R.id.datetime_gridview_addressline1) ;
              addressline2 =(TextView)itemLayoutView.findViewById(R.id.datetime_gridview_addressline2);
              addressline3= (TextView) itemLayoutView.findViewById(R.id.datetime_gridview_addressline3);
              mRemoveButton=(ImageView)itemLayoutView.findViewById(R.id.datetime_gridveiw_deletebtn);
              editbtn=(ImageView)itemLayoutView.findViewById(R.id.datetime_gridveiw_editbtn);
              selectaddress=(RadioButton)itemLayoutView.findViewById(R.id.selectaddress);
  
              itemLayoutView.setOnClickListener(new View.OnClickListener() {
                  @Override
                  public void onClick(View v) {
                  }
              });
          }
      }
  }
  </code></pre>