title: How to use correct Android theme when using programmatic components?
body: <p>I'm using the default basic app created in Android Studio "New Project". The app is using the Holo.Light.DarkActionBar theme, and this works fine as it is. I then changed the main activity onCreate() method to use programmatic components only (I have my reasons!), eg:</p>
  
  <pre><code>// setContentView(R.layout.activity_main); Removed!
  
  // Added this:
  setTheme(R.style.AppTheme);
  RelativeLayout.LayoutParams lParams = new RelativeLayout.LayoutParams(
      RelativeLayout.LayoutParams.WRAP_CONTENT,
      RelativeLayout.LayoutParams.WRAP_CONTENT);
  Button button = new Button(getApplicationContext());
  button.setText("Test");
  setContentView(button, lParams);
  </code></pre>
  
  <p>values/styles.xml:</p>
  
  <pre><code>&lt;style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar"&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p>AndroidManifest.xml:</p>
  
  <pre><code>&lt;application
      android:allowBackup="true"
      android:icon="@drawable/ic_launcher"
      android:label="@string/app_name"
      android:theme="@style/AppTheme" &gt;
  </code></pre>
  
  <p>However, now the button appears in the wrong theme. It looks like Holo Dark or something, but the colour is definitely wrong. Also, other components such as EditText also have the wrong theme. The action bar and main background theme appear to be correct.</p>
  
  <p>Is there something else that should be done in order to set the correct theme?</p>
  
  <p>Thanks</p>