title: Badge notification not showing in my tab layout
body: <p>I am try to show badge notification in my last tab of my application. But I get a <code>Null Object Reference</code> everytime and I am not able to understand Why or How. Here I have attached the <code>badge notification</code> code line and my TabLayout code Line. Please help me. I am using <code>VIewBadger</code> Library for my application.</p>
  
  <ol>
  <li><p>For Badge View</p>
  
  <pre><code>tabs = (TabWidget) findViewById(android.R.id.tabs);
  
  badge7 = new BadgeView(this, tabs, 1);
  
  badge7.setBadgePosition(BadgeView.POSITION_TOP_RIGHT);
  btnTab.setOnClickListener(new View.OnClickListener(){
      @Override
      public void onClick(View v) {
          badge7.toggle();
      }
  });
  </code></pre></li>
  <li><p>MY code to Add Tabs in TabWidget</p>
  
  <pre><code>    TabSpec spec4 = tabHost.newTabSpec("Tab 4");
      spec4.setIndicator("Logout", 
      getResources().getDrawable(R.drawable.custom_logout)); 
      Intent in4 = new Intent(this, LogoutActivity.class);
      spec4.setContent(in4);
  
      TabSpec spec3 = tabHost.newTabSpec("Tab 5");
      spec3.setIndicator("Chat", getResources().getDrawable(R.drawable.messaging)); // custom_logout   logout_icon_test
      Intent in5 = new Intent(this, ChatActivitylisting.class);
      spec3.setContent(in5);
  </code></pre></li>
  <li><p>Error Showing</p></li>
  </ol>
  
  <blockquote>
    <p>Caused by: java.lang.NullPointerException: Attempt to invoke virtual
    method 
          'void android.view.ViewGroup.addView(android.view.View, 
         android.view.ViewGroup$LayoutParams)' on a null object reference</p>
  </blockquote>