title: Navigation Drawer list view with 2 type
body: <p>I have a Navigation Drawer, With a ListView and with a header. When I scorll the drawer up down the items are mixed, the type of the items. Why? </p>
  
  <p>My DrawerAdapter.java:</p>
  
  <p>public class DrawerAdapter extends BaseAdapter {</p>
  
  <pre><code>private Context context;
  private List&lt;DrawerItem&gt; navDrawerItems;
  DrawerItemClickListener drawerItemClickListener;
  
  
  public DrawerAdapter(Context context, ArrayList&lt;DrawerItem&gt; navDrawerItems,DrawerItemClickListener drawerItemClickListener) {
      this.context = context;
      this.navDrawerItems = navDrawerItems;
      this.drawerItemClickListener = drawerItemClickListener;
  }
  
  @Override
  public int getCount() {
      return navDrawerItems.size();
  }
  
  @Override
  public Object getItem(int position) {
      return navDrawerItems.get(position);
  }
  
  @Override
  public long getItemId(int position) {
      return position;
  }
  
  @Override
  public boolean isEnabled(int position) {
      return false;
  }
  
  
  static class ViewHolder {
  ImageView imvIcon;
  TextView textView;
  LinearLayout layout;
  }
  
  
  @Override
  public int getViewTypeCount() {
      return 2;
  }
  
  @Override
  public int getItemViewType(int position) {
      return super.getItemViewType(position);
  }
  
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
  
      ViewHolder holder;
      final DrawerItem mItem = navDrawerItems.get(position);
  
      if(mItem.getType().equals(DrawerItem.TYPE_CLICKABLE))
      {
          if (convertView == null)
          {
              holder = new ViewHolder();
  
              LayoutInflater inflater = (LayoutInflater) parent.getContext().getSystemService(
                      Context.LAYOUT_INFLATER_SERVICE);
  
              convertView = inflater.inflate(R.layout.drawer_list_item, parent, false);
              holder.imvIcon = (ImageView) convertView.findViewById(R.id.item_icon);
              holder.textView = (TextView) convertView.findViewById(R.id.item_text);
              holder.layout = (LinearLayout) convertView.findViewById(R.id.drawer_one_layout);
  
              convertView.setTag(holder);
  
          }
          else {
              holder = (ViewHolder) convertView.getTag();
          }
  
          if(holder.imvIcon != null)
              Picasso.with(parent.getContext()).load(mItem.getIcon()).into(holder.imvIcon);
          if(holder.textView != null)
              holder.textView.setText(mItem.getTitle());
  
          if(holder.layout != null)
              holder.layout.setOnClickListener(new View.OnClickListener() {
                  @Override
                  public void onClick(View v) {
                      drawerItemClickListener.DrawerItemClicked(mItem);
                  }
              });
  
      }
      else
      {
  
          if (convertView == null)
          {
              holder = new ViewHolder();
  
              LayoutInflater inflater = (LayoutInflater) parent.getContext().getSystemService(
                      Context.LAYOUT_INFLATER_SERVICE);
  
                  convertView = inflater.inflate(R.layout.drawer_list_item_two, parent, false);
                  holder.textView = (TextView) convertView.findViewById(R.id.item_text);
  
              convertView.setTag(holder);
  
          }
          else {
              holder = (ViewHolder) convertView.getTag();
          }
  
              holder.textView.setText(mItem.getTitle());
  
      }
  
      return convertView;
  }}
  </code></pre>
  
  <p>And the Drawer Item :</p>
  
  <p>public class DrawerItem {</p>
  
  <pre><code>public final static String TYPE_CLICKABLE = "clikc";
  
  public final static String TYPE_HEADER = "header";
  
  private String title, type;
  private int icon;
  
  public DrawerItem(String title, int icon, String type) {
      this.title = title;
      this.icon = icon;
      this.type = type;
  
  }
  
  public String getTitle() {
      return title;
  }
  
  public int getIcon() {
      return icon;
  }
  
  public String getType() {return this.type;}}
  </code></pre>
  
  <p>Please help me. Thanks.</p>