title: Add badge to tab
body: <p>How can I add a badge to tab ? I am using this code</p>
  
  <pre><code>protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      viewPager = (ViewPager) findViewById(R.id.pager);
      actionBar = getActionBar();
      mAdapter = new TabsPagerAdapter(getSupportFragmentManager());
  
      viewPager.setAdapter(mAdapter);
      actionBar.setHomeButtonEnabled(false);
      actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);        
  
      // Adding Tabs
      for (String tab_name : tabs) {
          actionBar.addTab(actionBar.newTab().setText(tab_name)
                  .setTabListener(this));
      }
  
      /**
       * on swiping the viewpager make respective tab selected
       * */
      viewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
  
          @Override
          public void onPageSelected(int position) {
              // on changing the page
              // make respected tab selected
              actionBar.setSelectedNavigationItem(position);
          }
  
          @Override
          public void onPageScrolled(int arg0, float arg1, int arg2) {
          }
  
          @Override
          public void onPageScrollStateChanged(int arg0) {
          }
      });
  }
  </code></pre>
  
  <p>main activity.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical" &gt;
  
      &lt;FrameLayout
          android:id="@+id/container"
          android:layout_width="match_parent"
          android:layout_height="match_parent" /&gt;
  
      &lt;android.support.v4.view.ViewPager
          xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/pager"
          android:layout_width="match_parent"
          android:layout_height="match_parent" &gt;
      &lt;/android.support.v4.view.ViewPager&gt;
  
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p>Tabs adapter java</p>
  
  <pre><code>public class TabsPagerAdapter extends FragmentPagerAdapter {
  
      public TabsPagerAdapter(FragmentManager fm) {
          super(fm);
      }
  
      @Override
      public Fragment getItem(int index) {
  
          switch (index) {
          case 0:
  
              return new RandomsFragment();
          case 1:
              return new ChatsFragment();
          }
          return null;
      }
  
      @Override
      public int getCount() {
          return 2;
      }
  
  }
  </code></pre>
  
  <p>I am following this tutorial for tabs:<a href="http://www.androidhive.info/2013/10/android-tab-layout-with-swipeable-views-1/" rel="nofollow">http://www.androidhive.info/2013/10/android-tab-layout-with-swipeable-views-1/</a></p>
  
  <p>I didn't understand how can I add a badge to tabs.</p>