title: Get selected radio button position inside listview
body: <p>I am trying to use settag for selected radio button to store its position in my BaseAdapter and access it from other class.</p>
  
  <p>I am able to select single choice but I need to get the name of the image when the radio button is selected.</p>
  
  <p>This is my BaseAdapter GetView:</p>
  
  <pre><code>    public View getView(final int position, View convertView, ViewGroup parent) {
      ViewHolder holder;
      if (convertView == null) {
          convertView = l_Inflater.inflate(R.layout.item_details_view, null);
          holder = new ViewHolder();
          holder.txt_itemName = (TextView) convertView.findViewById(R.id.name);
          holder.txt_itemDescription = (TextView) convertView.findViewById(R.id.itemDescription);
          holder.txt_itemPrice = (TextView) convertView.findViewById(R.id.price);
          holder.itemImage = (ImageView) convertView.findViewById(R.id.photo);
          holder.button = (RadioButton)convertView.findViewById(R.id.rbSelectedOption);                                                     
  
          convertView.setTag(holder);
      } else {
          holder = (ViewHolder) convertView.getTag();
      }
  
      holder.txt_itemName.setText(itemDetailsrrayList.get(position).getName());
      holder.txt_itemDescription.setText(itemDetailsrrayList.get(position).getItemDescription());
      holder.txt_itemPrice.setText(itemDetailsrrayList.get(position).getPrice());
      holder.itemImage.setImageResource(imgid[itemDetailsrrayList.get(position).getImageNumber() - 1]);
  
      holder.button.setTag(position);  
  
      holder.button.setOnClickListener(new View.OnClickListener() {  
                      public void onClick(View v) { 
              if((position != mSelectedPosition &amp;&amp; mSelectedRB != null)){
                  mSelectedRB.setChecked(false);
              }
              mSelectedPosition = position;
              mSelectedRB = (RadioButton)v;
          }
      });
  
          if(mSelectedPosition != position){
              holder.button.setChecked(false);
          }else{
              holder.button.setChecked(true);
              if(mSelectedRB != null &amp;&amp; holder.button!= mSelectedRB){
                  mSelectedRB = holder.button;
              }
          }         
      return convertView;
  }
  </code></pre>
  
  <p>And this is my ListViewActivity:</p>
  
  <pre><code>ArrayList&lt;ItemDetails&gt; image_details = GetSearchResults();
  
      final ListView lv1 = (ListView) findViewById(R.id.list);
      lv1.setAdapter(new ItemListBaseAdapter(this, image_details));
      lv1.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
  
      final RadioButton SelectedOption = (RadioButton) findViewById(R.id.rbSelectedOption);
      lv1.setOnItemClickListener(new OnItemClickListener() {
          @Override
          public void onItemClick(AdapterView&lt;?&gt; a, View v, int position, long id) { 
              int pos = (Integer) v.getTag();
              Object o = SelectedOption.getTag(pos);
              ItemDetails obj_itemDetails = (ItemDetails)o;
              Toast.makeText(ListViewImagesActivity.this, "You have chosen : " + " " + obj_itemDetails.getName(), Toast.LENGTH_LONG).show();
              CarName =obj_itemDetails.getName();
         }  
      });
  </code></pre>
  
  <p>I'm unable to get the positon by using the getTag:</p>
  
  <pre><code>int pos = (Integer) v.getTag();
  Object o = SelectedOption.getTag(pos);
  </code></pre>
  
  <p>Can anyone say me how do I get the position from my BaseAdapter Class to ListViewActivity ?</p>