title: TabHost on Android 4.2 - Icons and Colours Not Showing on Tabs
body: <p>We're very new to Android development, so apologies if this is obvious.</p>
  
  <p>We're implementing an activity using a tabbed view. The problem we are having is that the icons and proper colours on the tabs themselves do not show up properly on Jelly Bean (Android 4.2). They DO, however, display properly on earlier API levels, such as Gingerbread. </p>
  
  <p>Please note: We did originally create the view using the deprecated TabActivity class. However, as far as I can tell, the "newer" way of doing this shouldn't be that different from the old? Please correct me if I am wrong.</p>
  
  <p>This is the xml containing the tab host layout:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;TabHost xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@android:id/tabhost"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:background="@color/Black"&gt;
  
      &lt;LinearLayout
          android:orientation="vertical"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:padding="5dp"&gt;
  
          &lt;include layout="@layout/logo_bar"/&gt;
  
          &lt;TabWidget
              android:id="@android:id/tabs"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:layout_weight="0"/&gt;
  
          &lt;FrameLayout
              android:id="@android:id/tabcontent"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_weight="1" &gt;
          &lt;/FrameLayout&gt;
       &lt;/LinearLayout&gt;
  &lt;/TabHost&gt;
  </code></pre>
  
  <p>Here is the relevant (I hope) activity code:</p>
  
  <pre><code>public class MainTabActivity extends FragmentActivity implements TabHost.TabContentFactory
      private TabHost tabHost;
      // other instance variables ...
  
      @Override
      public void onCreate(Bundle savedInstanceState){
          super.onCreate(savedInstanceState);
          tabHost = (TabHost)findViewById(android.R.id.tabhost);
          tabHost.setup();
  
          TabSpec loginTabSpec = tabHost.newTabSpec(GlobalConstants.LOGIN_ACTIVITY);
          loginTabSpec.setIndicator("Settings", getResources().getDrawable(R.drawable.ic_action_settings_gear));
          loginTabSpec.setContent(this);
  
          TabSpec mainTabSpec = tabHost.newTabSpec(GlobalConstants.MAIN_ACTIVITY);
          mainTabSpec.setIndicator("Lone Worker", getResources().getDrawable(R.drawable.ic_action_settings_phone));
          mainTabSpec.setContent(this);
  
          tabHost.addTab(mainTabSpec);
          tabHost.addTab(loginTabSpec);
      }
  </code></pre>
  
  <p>This is what the tab itself looks like on Jelly Bean (bad version):<img src="https://i.stack.imgur.com/wZJM2.png" alt="enter image description here"></p>
  
  <p>And finally, this is what it should look like (on gingerbread... good version):<img src="https://i.stack.imgur.com/neULa.jpg" alt="enter image description here"></p>
  
  <p>So to re-iterate: The background colour of the tab is black (when it is normally that nice blue colour), and though it is difficult to tell from the bad screen shot, the icons for either tab are missing show up on jelly bean. I hope the problem is outlined enough here. Please let me know if I've left anything out. Thank you in advance!</p>