title: How to set tag the ID to a checkbox android
body: <p>I have created the custom adapter as follows.</p>
  
  <pre><code>public class sendivitesadapter extends ArrayAdapter&lt;Item&gt;{
      private Context context;
      private ArrayList&lt;Item&gt; items;
      private qrusers qrusers;
      private LayoutInflater vi;
      private String[] array;
      qrusers qrus;
  
      public sendivitesadapter(Context context,ArrayList&lt;Item&gt; items) {
          super(context, 0,items);
  
          this.context= context;
          this.qrusers =(qrusers) context;
          this.items = items;
          vi = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  
      }
      @Override
      public int getCount() {
          // TODO Auto-generated method stub
          return super.getCount();
      }
  
      @Override
      public Item getItem(int position) {
          // TODO Auto-generated method stub
          return super.getItem(position);
      }
  
          @Override
          public View getView(final int position, View convertView, ViewGroup parent) {
              View v = convertView;
  
              final Item i = items.get(position);
  
              if (i != null) {
                  if(i.isSection()){
                      SectionItem si = (SectionItem)i;
                      v = vi.inflate(R.layout.checkboxlist, null);
  
                      v.setOnClickListener(null);
                      v.setOnLongClickListener(null);
                      v.setLongClickable(false);
  
                      final TextView sectionView = (TextView) v.findViewById(R.id.list_item_section_text);
                      sectionView.setText(si.getTitle());
  
                  }else{
                      sendItem ei = (sendItem)i;
                      v = vi.inflate(R.layout.checkboxlist, null);
                      final TextView title = (TextView)v.findViewById(R.id.contactname);
                      final TextView subtitle = (TextView)v.findViewById(R.id.companyname);
                      final CheckBox checkBox=(CheckBox)v.findViewById(R.id.checboxlist);
                      //checkBox.setTag(qrus.uid);
  
  
  
                  //    Log.e("IDDDDDDD", text);
                      //checkBox.setTag("12");
                      checkBox.setOnClickListener(new OnClickListener() {
  
                          @Override
                          public void onClick(View v) {
                              // TODO Auto-generated method stub
                              String s=(String) v.getTag();
                              Log.e("IDDDDDDDDDDDDDDDDDDDDDD", s);
                          }
                      });
                      if (title != null) 
                          title.setText(ei.contactname);
                      if(subtitle != null)
                          subtitle.setText(ei.companyname);
  
                  }
              }
              return v;
          }   
  
  }
  </code></pre>
  
  <p>And my activity where I have assigned this adapter to a listview is as follows.</p>
  
  <pre><code>@Override
      protected void onPostExecute(String result) {
          JSONArray jarray;
  
          try {
              jarray= new JSONArray(result);
  
              name= new String[jarray.length()];
              company=new String[jarray.length()];
              uid=new String[jarray.length()];
              for (int i=0;i&lt;jarray.length();i++){
  
  
  
                  JSONObject jobj = jarray.getJSONObject(i);
                  name[i]=    jobj.getString("Name");
                  company[i]=jobj.getString("Company");
                  uid[i]=jobj.getString("UserID");
                  System.out.println(uid[i]);
  
  
  
                  items.add(new sendItem(name[i], company[i], qrcheckBox));
  
                  sendadapter  = new sendivitesadapter(qrusers.this,items);
                  listView.setAdapter(sendadapter);
  </code></pre>
  
  <p>Now as you see I get the name ,company and uid from webservice. I get the ID of user in string array uid. Now I want to set the uid to the checkbox which i have created in custom adapter.  and on click of that it should hold the uid. How can i achieve this?</p>