title: get item view type in adapter returning only 1 item
body: <p>I have a custom adapter which will inflate two layout according to a certain condition.
  GetItemViewType returning only 1 item in the position while there is two and when i present it in the list the adapter inflate one layout the other is not and i can see in my list that there is a space left for it but its blank.
  here is my code</p>
  
  <pre><code>enter code here
  public class ListViewAdapter extends ArrayAdapter&lt;NewsFeed&gt;
  {
      private static final int missionLayout = 0;
      private static final int badgeLayout = 1;
      private TreeSet mSeparatorsSet = new TreeSet();
      public ListViewAdapter ()
      {
          super(CityNewsFeedActivity.this,R.layout.activity_activity_city_news_feed,newsfeed);
      }
      @Override
      public int getItemViewType(int position)
      {
          return mSeparatorsSet.contains(position) ? missionLayout : badgeLayout;
      }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent)
      {
          ViewHolder holder=null;
  
          int type = getItemViewType(position);
          System.out.println("getView " + position + " " + convertView + " type = " + type);
          if (convertView == null)
          {
              NewsFeed obj = newsfeed.get(position);
              holder = new ViewHolder();
              switch (type)
              {
                  case missionLayout:
                      Log.d("fet 3ala mission layout","tahet il case");
                      convertView = getLayoutInflater().inflate(R.layout.city_news_single_item, parent,false);
                      holder.civilianImage = (ImageView) convertView.findViewById(R.id.imageView2);
                      holder.heroName = (TextView) convertView.findViewById(R.id.badgename);
                      holder.description = (TextView) convertView.findViewById(R.id.description);
                      holder.timeRemaining = (TextView) convertView.findViewById(R.id.postedSince);
                      holder.relativeLayoutMission = (RelativeLayout) convertView.findViewById(R.id.relativeLayout);
  
                      if (obj.category.equals("mission"))
                      {
  
                          if (obj.accepted_rejected.equals("success"))
                          {
                              holder.relativeLayoutMission.setBackgroundResource(R.drawable.mission_successful);
                              Float alpha = Float.valueOf("0.9");
                              holder.relativeLayoutMission.setAlpha(alpha);
                              byte[] decodedString = Base64.decode(obj.picture, Base64.DEFAULT);
                              Bitmap decodedByte = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length);
                              Bitmap circleBitmap = Bitmap.createBitmap(decodedByte.getWidth(), decodedByte.getHeight(), Bitmap.Config.ARGB_8888);
                              BitmapShader shader = new BitmapShader(decodedByte, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);
                              Paint paint = new Paint();
                              paint.setShader(shader);
                              Canvas c = new Canvas(circleBitmap);
                              c.drawCircle(decodedByte.getWidth() / 2, decodedByte.getHeight() / 2, decodedByte.getWidth() / 2, paint);
                              holder.civilianImage.setImageBitmap(circleBitmap);
                              Drawable d = getResources().getDrawable(
                                      R.drawable.circle_shape_for_civilian_success);
                              holder.civilianImage.setBackgroundDrawable(d);
                              String hero = obj.mission_nickname;
  
                              holder.heroName.setText(Html.fromHtml("&lt;font color='#FAD84F'&gt;" + hero + "&lt;/font&gt;" + " saved " + obj.firstname + " " + obj.lastname));
                              holder.description.setText(obj.description);
                              holder.timeRemaining.setText(obj.mission_postedSince);
                             }
                         }
                        break;
                 case badgeLayout:
  
                      convertView =   getLayoutInflater().inflate(R.layout.badge_single_item, null);
                      holder.relativeLayoutBadge = (RelativeLayout) convertView.findViewById(R.id.relativeLayout);
                      holder.BadgeName = (TextView) convertView.findViewById(R.id.badgename);
                      holder.badgeImage = (ImageView) convertView.findViewById(R.id.imageView2);
                      holder.timeRemaining = (TextView) convertView.findViewById(R.id.postedSince);
  
                      if (obj.category.equals("badge"))
                      {
                          holder.relativeLayoutBadge.setBackgroundResource(R.drawable.earned_badge_post);
                          Float alpha = Float.valueOf("0.9");
                          holder.relativeLayoutBadge.setAlpha(alpha);
                          String hero = obj.nickname;
                          holder.BadgeName.setText(Html.fromHtml("&lt;font color='#FAD84F'&gt;" + hero + "&lt;/font&gt;" + " earns a new badge! "));
                          Drawable d = getResources().getDrawable(R.drawable.circle_shape_for_badge);
                          holder.badgeImage.setBackgroundDrawable(d);
                          String imageUrl = "http://iamheroic.net/iamheroic/badge_images/" + obj.icon;
                          imageLoader.displayImage(imageUrl, holder.badgeImage, options);
                          holder.timeRemaining.setText(obj.postedSince);
                      }
                      break;
  
              }
              if (convertView != null)
              {
                  convertView.setTag(holder);
              }
          }
          return convertView;
      }
  }
  </code></pre>
  
  <p>When i run the app the list shows one layout of type 1 and leaves space for type 0 but its not presented.
  Any help would be appreciated.</p>