title: Customizing a AlertDailog.Builder Android
body: <p>I am trying to customize my AlertDailog. I am OK with the default layout of the AlertDailog, so i  don't want to set any particular view to my dailog, I just want to change small things like text color, background color etc.</p>
  
  <p>I have tried two approaches, which seems to be correct but surprisingly both of them does not work.</p>
  
  <p>First, I have tried to create the AlertDailog with a custom style like :</p>
  
  <pre><code>    AlertDialog.Builder builder = new AlertDialog.Builder(this,R.style.cust_dialog);
  </code></pre>
  
  <p>which gives me output like </p>
  
  <p><img src="https://i.stack.imgur.com/2gv5k.png" alt="enter image description here">  </p>
  
  <p>I did not understand why there it is a dailog within a box and even the text color did not change, so i have tried another way.</p>
  
  <p>I created a ContextThemeWrapper and passed it to AlertDailog.Builder</p>
  
  <pre><code>    ContextThemeWrapper ctw = new ContextThemeWrapper(this,R.style.cust_dialog);
          AlertDialog.Builder builder = new AlertDialog.Builder(ctw);
  </code></pre>
  
  <p>The output was </p>
  
  <p><img src="https://i.stack.imgur.com/KPGsQ.png" alt="enter image description here"></p>
  
  <p>still the text color or background was not changed.</p>
  
  <p>my cust_dialog.xml is</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;resources&gt;
      &lt;style name="cust_dialog" parent="@android:style/Theme.Holo.Light.Dialog"&gt;
          &lt;item name="android:windowBackground"&gt;@color/brown&lt;/item&gt;
          &lt;item name="android:textColor"&gt;@color/red&lt;/item&gt;
      &lt;/style&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <p>Can somebody tell me what am i doing wrong or what is the correct way to do this?</p>
  
  <p>Thank you :)</p>