title: Navigation Drawer items repeating
body: <p>I am using a navigation drawer with the listview layout. The items to be populated in the listview are textviews, radiobuttons and checkboxes. The xml layout file is as below.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:orientation="vertical" &gt;
  
  &lt;TextView 
      android:id="@+id/tv1"
      android:layout_width="fill_parent"
      android:layout_height="56dp"
      android:text="Settings"
      android:textSize="24dp"
      android:gravity="center" /&gt;
  
  &lt;RadioGroup 
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:id="@+id/radio_group" &gt;
  
  &lt;RadioButton 
      android:id="@+id/rbs1"
      android:layout_width="fill_parent"
      android:layout_height="56dp"
      android:text="Male"/&gt;
  
  &lt;RadioButton 
      android:id="@+id/rbs2"
      android:layout_width="fill_parent"
      android:layout_height="56dp"
      android:text="Female"/&gt;
  
  &lt;RadioButton 
      android:id="@+id/rbs3"
      android:layout_width="fill_parent"
      android:layout_height="56dp"
      android:text="All"
      android:checked="true"/&gt;
  
  &lt;/RadioGroup&gt;
  
  &lt;TextView 
      android:id="@+id/tv2"
      android:layout_width="fill_parent"
      android:layout_height="56dp"
      android:text="Experience"
      android:textSize="24dp"
      android:gravity="center"/&gt;
  
  &lt;CheckBox 
      android:id="@+id/cbs1"
      android:layout_width="fill_parent"
      android:layout_height="56dp"
      android:text="1 yr"/&gt;
  
  &lt;CheckBox 
      android:id="@+id/cbs2"
      android:layout_width="fill_parent"
      android:layout_height="56dp"
      android:text="&gt;1 yr"/&gt;
  
  &lt;CheckBox 
      android:id="@+id/cbs3"
      android:layout_width="fill_parent"
      android:layout_height="56dp"
      android:text="&gt;2 yr"/&gt;
  
  &lt;CheckBox 
      android:id="@+id/cbs4"
      android:layout_width="fill_parent"
      android:layout_height="56dp"
      android:text="&gt;5 yr"/&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>For this am setting an Adapter as</p>
  
  <pre><code>listView.setAdapter(new DrawerAdapter(this,R.layout.draw_list_item));
  </code></pre>
  
  <p>The code for adapter is below.</p>
  
  <pre><code>package com.example.navdrawer;
  
  import android.app.Activity;
  import android.content.Context;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.BaseAdapter;
  import android.widget.CheckBox;
  import android.widget.ListAdapter;
  import android.widget.RadioButton;
  import android.widget.RadioGroup;
  import android.widget.TextView;
  
  public class DrawerAdapter extends BaseAdapter implements ListAdapter {
  private Context context;
  private int drawListItem;
  ViewHolder viewHolder;
  public DrawerAdapter(Context context, int drawListItem) {
      // TODO Auto-generated constructor stub
      this.context = context;
      this.drawListItem = drawListItem;
  }
  
  @Override
  public int getCount() {
      // TODO Auto-generated method stub
      return drawListItem;
  }
  
  @Override
  public Object getItem(int position) {
      // TODO Auto-generated method stub
      return drawListItem;
  }
  
  @Override
  public long getItemId(int position) {
      // TODO Auto-generated method stub
      return drawListItem;
  }
  
  static class ViewHolder {
      TextView txt1;
      RadioButton rb1;
      RadioButton rb2;
      RadioButton rb3;
      TextView txt2;
      CheckBox cb1;
      CheckBox cb2;
      CheckBox cb3;
      CheckBox cb4;
  }
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
      // TODO Auto-generated method stub
      viewHolder = null;
      if(convertView == null){
          LayoutInflater inflater = ((Activity) context).getLayoutInflater();
          convertView = inflater.inflate(drawListItem, parent, false);
          viewHolder = new ViewHolder();
          viewHolder.txt1 = (TextView) convertView.findViewById(R.id.tv1);
          viewHolder.rb1 = (RadioButton) convertView.findViewById(R.id.rbs1);
          viewHolder.rb2 = (RadioButton) convertView.findViewById(R.id.rbs2);
          viewHolder.rb3 = (RadioButton) convertView.findViewById(R.id.rbs3);
          viewHolder.txt2 = (TextView) convertView.findViewById(R.id.tv2);
          viewHolder.cb1 = (CheckBox) convertView.findViewById(R.id.cbs1);
          viewHolder.cb2 = (CheckBox) convertView.findViewById(R.id.cbs2);
          viewHolder.cb3 = (CheckBox) convertView.findViewById(R.id.cbs3);
          viewHolder.cb4 = (CheckBox) convertView.findViewById(R.id.cbs4);
          convertView.setTag(viewHolder);
      } else{
          viewHolder = (ViewHolder) convertView.getTag();
          }
      return convertView;
  }
  
  }
  </code></pre>
  
  <p><strong>What i need is i want to display those items in a listview in the navigation drawer. But the problem is that all these items are repeating in the navigation drawer.</strong>
  Please help me with a solution. Thanx in advance.</p>