title: Trouble with Android TabHost
body: <p>I want to creat my tab host programmaticly, as it seems I can't add icons otherwise? Anyways... This is how I do it. I get an error when trying to use the tabHost.addTab() function.</p>
  
  <pre><code>private void setupTabs() {
      Log.d("DEBUG", "Starting tab setup");
      createTab("Hjem", R.drawable.ic_menu_home, HomeActivity.class);
      createTab("Nyheter", R.drawable.ic_menu_home, HomeActivity.class);
      createTab("Podcast", R.drawable.ic_menu_home, HomeActivity.class);
      Log.d("DEBUG", "Finished tab setup");
  }
  
  private void createTab(String label, int drawableId, Class&lt;?&gt; activity) {
      //Create tab
      TabHost tabHost = (TabHost) findViewById(R.id.tabHost);
      TabSpec spec = tabHost.newTabSpec("tab" + label);
  
      //Set indicator
      Drawable image = ContextCompat.getDrawable(this, drawableId);
      spec.setIndicator(label, image);
  
      //Set content
      Intent intent = new Intent(this, activity);
      spec.setContent(intent);
  
      //Add tab
      tabHost.addTab(spec);
  }
  </code></pre>