title: I can't change my AlertDialog theme
body: <p>I am in need of some guide to solve an issue with android themes. </p>
  
  <p>I have created a custom theme in order to apply it to an Alert Dialog. Everything seems fine and dandy however, when I try to apply it to the actual dialog using ContextThemeWrapper, the android.R.style.MyTheme is not recognized.</p>
  
  <p>Here is my code inside MainActivity.java:</p>
  
  <pre><code>// Build CheckBox Dialog
      @Override
      public Dialog onCreateDialog(Bundle savedInstanceState) {
  
          AlertDialog.Builder checkboxDialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(getActivity(), 
                  android.R.style.MyTheme));
  
          checkboxDialogBuilder
                  .setTitle("Pick the colors")
                  .setSingleChoiceItems(items, -1,
                          new DialogInterface.OnClickListener() {
  
                              // indexSelected contains the index of item (of which checkbox checked)
                              @Override
                              public void onClick(DialogInterface dialog, int item) {
                                   switch(item)
                                      {
                                          case 0:
                                                  // RGB choice
                                                  RGB = true;
                                                  break;
  
                                          case 1:
                                                  // CMY choice
                                                  RGB = false;
                                                  break;
                                      }
                              }
                          })
  
                  // Set the action buttons
                  .setPositiveButton("OK", new DialogInterface.OnClickListener() {
                               @Override
                               public void onClick(DialogInterface dialog, int id) {
                                   // user clicked on OK
                                   setColorModeBackground();  
                               }
                  })
  
                  .setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
                               @Override
                               public void onClick(DialogInterface dialog, int id) {
                                  // user clicked on Cancel
                                  mDialog.dismiss();
                               }
                  });
  
          AlertDialog customCheckboxDialog = checkboxDialogBuilder.create();
  
          customCheckboxDialog.show();
  
          return customCheckboxDialog;
      }
  </code></pre>
  
  <p>In this line I get an error because android.R.style.Mytheme doesn't exist apparently, even though I see it in the R.java file.             </p>
  
  <p>AlertDialog.Builder checkboxDialogBuilder = new AlertDialog.Builder(new ContextThemeWrapper(getActivity(), android.R.style.MyTheme));</p>
  
  <p>R.java file:</p>
  
  <pre><code>public static final class style {
      /** 
   Base application theme, dependent on API level. This theme is replaced
   by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
  
  
       Theme customizations available in newer API levels can go in
       res/values-vXX/styles.xml, while customizations related to
       backward-compatibility can go here.
  
  
      Base application theme for API 11+. This theme completely replaces
      AppBaseTheme from res/values/styles.xml on API 11+ devices.
  
      API 11 theme customizations can go here. 
       */
  
      public static final int AppBaseTheme=0x7f060000;
  
      /**  Application theme. All customizations that are NOT specific to a 
      particular API-level can go here. 
       */
  
      public static final int AppTheme=0x7f060001;
      public static final int MyTheme=0x7f060007;
      /** 
      Base application theme for API 14+. This theme completely replaces
      AppBaseTheme from BOTH res/values/styles.xml and
      res/values-v11/styles.xml on API 14+ devices.
  
       */
      public static final int base=0x7f060002;
      public static final int body=0x7f060004;
      public static final int customDialogTheme=0x7f060005;
      public static final int dialogTheme=0x7f060006;
      public static final int title=0x7f060003;
  }
  </code></pre>
  
  <p>And here is the file in the res/values/styles.xml:</p>
  
  <pre><code>    &lt;style name="AppBaseTheme" parent="android:Theme.Light"&gt;
       &lt;!--
           Theme customizations available in newer API levels can go in
           res/values-vXX/styles.xml, while customizations related to
           backward-compatibility can go here.
       --&gt;
     &lt;/style&gt;
  
     &lt;!-- Application theme. --&gt;
      &lt;style name="MyTheme" parent="AppBaseTheme"&gt;
          &lt;item name="android:alertDialogStyle"&gt;@style/customDialogTheme&lt;/item&gt;
      &lt;/style&gt;
  
      &lt;style name="customDialogTheme" parent="@android:style/Theme.Dialog"&gt;
          &lt;item name="android:alertDialogStyle"&gt;@style/customDialogTheme&lt;/item&gt;
          &lt;item name="android:fullDark"&gt;@drawable/dialog_body&lt;/item&gt;
          &lt;item name="android:topDark"&gt;@drawable/dialog_title&lt;/item&gt;
          &lt;item name="android:centerDark"&gt;@drawable/dialog_body&lt;/item&gt;
          &lt;item name="android:bottomDark"&gt;@drawable/dialog_footer&lt;/item&gt;
          &lt;item name="android:fullBright"&gt;@drawable/dialog_body&lt;/item&gt;
          &lt;item name="android:centerBright"&gt;@drawable/dialog_body&lt;/item&gt;
          &lt;item name="android:bottomBright"&gt;@drawable/dialog_footer&lt;/item&gt;
          &lt;item name="android:bottomMedium"&gt;@drawable/dialog_footer&lt;/item&gt;
          &lt;item name="android:centerMedium"&gt;@drawable/dialog_body&lt;/item&gt;
      &lt;/style&gt;
  </code></pre>
  
  <p>Thanks in advance!</p>