title: Android custom list view get adapter
body: <p>hi guys i have been searching for way to get the details of the custom listview. For example i have listview in which a custom view containing a checkbox will be embeded. All that i need to do is to find the state of the checkbox on click of an button. Also need to know how to use the getAdapter method in this case..</p>
  
  <p>Thanks in Advance..</p>
  
  <p>Edit #1</p>
  
  <pre><code>class MyEthnicityAdapter extends BaseAdapter {
      Context rContext;
      private LayoutInflater rInflater;
      View view;
      public MyEthnicityAdapter(Context c) {
  
          rInflater = LayoutInflater.from(c);
  
          rContext = c;
  
      }
  
      @Override
      public int getCount() {
          /* return Library.s.size(); */
          return getResources().getStringArray(R.array.ethnicity).length;
      }
  
      @Override
      public Object getItem(int position) {
  
          // return null;
          System.out.println("My view l;st size is===&gt; " + viewList.size());
          //return viewList.get(position);
          return view;
      }
  
      @Override
      public long getItemId(int position) {
          // TODO Auto-generated method stub
          return 0;
      }
  
      @Override
      public View getView(final int position, View convertView,
              ViewGroup parent) {
          // TODO Auto-generated method stub
          convertView = rInflater.inflate(R.layout.custom_multi_select, null);
          EthinicityDataClass mydat = new EthinicityDataClass();
  
          mydat.ethinicitycheck = (CheckBox) convertView
                  .findViewById(R.id.ethnicity_check);
  
          mydat.ethinicitycheck.setText(getResources().getStringArray(
                  R.array.ethnicity)[position]);
  
  
          view=convertView;
          return convertView;
      }
  
      class EthinicityDataClass {
  
          CheckBox ethinicitycheck;
      }
  
  }
  </code></pre>
  
  <p>and i set the adapter like this. <code>ethnicityListview = (ListView) findViewById(R.id.ethnicityListview);
          ethnicityListview.setAdapter(new MyEthnicityAdapter(this));</code></p>