title: Android tabview icon with background color
body: <p>I am trying to make a tabview in android that has icon alongwith background. But can't set background of the tab.</p>
  
  <p>java</p>
  
  <pre><code>intent = new Intent().setClass(this, mainActivity.class);   
  spec = tabHost.newTabSpec("main").setIndicator("Main", res.getDrawable(R.drawable.ic_tab_main)).setContent(intent);   
  tabHost.addTab(spec); 
  </code></pre>
  
  <p>xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;   
      &lt;item android:drawable="@drawable/cameraiconblack"        
            android:state_selected="true" /&gt; 
      &lt;item android:drawable="@drawable/cameraiconwhite" /&gt;
  &lt;/selector&gt;
  </code></pre>