title: Android add badge to list
body: <p>I have a list,and I want to add badge to each item.I am using this library:<a href="https://github.com/jgilfelt/android-viewbadger" rel="nofollow noreferrer">https://github.com/jgilfelt/android-viewbadger</a> </p>
  
  <p>And this is my code:</p>
  
  <pre><code>static class ViewHolder {
      TextView nameView;
      ImageView imageView;
      BadgeView badge;
  }
  public void placeRandomUsers(final String search) {
      randomAdapter = new ArrayAdapter&lt;JsonObject&gt;(this, 0) {
          @Override
          public View getView(int position, View convertView, ViewGroup parent) {
              ViewHolder holder;
              if (convertView == null) {
                  convertView = getLayoutInflater().inflate(R.layout.random_bars, null);
                  holder = new ViewHolder();
                  holder.nameView=(TextView)convertView.findViewById(R.id.tweet);
                  holder.badge = new BadgeView(getContext(), holder.nameView);
                  holder.badge.setTextColor(Color.BLACK);
                  holder.badge.setBadgeBackgroundColor(Color.parseColor("#A4C639"));
                  holder.imageView=(ImageView)convertView.findViewById(R.id.image);
                  convertView.setTag(holder);
              } else {
                  holder = (ViewHolder) convertView.getTag();
              }
              if (position &gt;= getCount() - 3 &amp;&amp; search.equals("") == true) {
                  //loadRandomUsers("");
              }
              JsonObject user=getItem(position);
              String name=user.get("name").getAsString();
              String image_url="http://domain/photos/profile/thumb/"+user.get("photo").getAsString();
  
              holder.nameView.setText(name);
  
  
              Ion.with(holder.imageView)
              .placeholder(R.drawable.twitter)
              .load(image_url);
              holder.badge.setText("1");
              holder.badge.show();
              return convertView;
          }
      };
  
      ListView listView = (ListView)findViewById(R.id.list);
      listView.setAdapter(randomAdapter);
      listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
          @Override
          public void onItemClick(AdapterView&lt;?&gt; parent, View view,
                  int position, long id) {
              //Log.w("Pos","asd"+randomAdapter.getItem(position).get("name").getAsString());
              startChat(randomAdapter.getItem(position));
  
          }
      });
      loadRandomUsers(search);
  }
  </code></pre>
  
  <p>And this is my random_bars.xml</p>
  
  
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:padding="4dp"
                android:orientation="horizontal"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"&gt;
  
      &lt;ImageView
              android:id="@+id/image"
              android:layout_width="64dp"
              android:layout_height="64dp"
              android:src="@drawable/twitter"/&gt;
  
      &lt;LinearLayout
              android:paddingLeft="4dp"
              android:paddingRight="4dp"
              android:layout_weight="1"
              android:orientation="vertical"
              android:layout_width="0dp"
              android:layout_height="wrap_content"&gt;
  
          &lt;TextView
                  style="@android:style/TextAppearance.Medium"
                  android:id="@+id/handle"
                  android:layout_width="match_parent"
                  android:layout_height="0dp"
                  android:layout_weight="1"/&gt;
  
          &lt;TextView
                  android:id="@+id/tweet"
                  style="@android:style/TextAppearance.Small"
                  android:layout_width="match_parent"
                  android:layout_height="0dp"
                  android:layout_weight="1"/&gt;
      &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>When I add badge to each item,<code>nameView</code> is not showing.Here the output:</p>
  
  <p><img src="https://i.stack.imgur.com/aOqHQ.jpg" alt="enter image description here"></p>
  
  <p>If I remove the badge codes.Output is:</p>
  
  <p><img src="https://i.stack.imgur.com/fUBVh.jpg" alt="enter image description here"></p>
  
  <p>Here you can see.Image is showing but name is not showing when I use the badge class.What can be cause this ?</p>