title: Setting message text appearance in Alert Dialog using XML (Android API Level 23)
body: <p>I was trying to set the text size of message in an alert dialog, but was unable to after many attempts.  On the other hand, the title and button text sizes can be controlled by the theme's font size simultaneously (set to 14sp in the example below).</p>
  
  <p>The alert dialog was created using the following XML style description, following the approach described in <a href="http://blog.supenta.com/2014/07/02/how-to-style-alertdialogs-like-a-pro" rel="nofollow noreferrer">this blog</a>:</p>
  
  <pre><code>&lt;style name="MyAlertDialogTheme" parent="@android:style/Theme.Holo.Dialog.NoActionBar"&gt;
      &lt;item name="colorAccent"&gt;#ffffff&lt;/item&gt;
  
      &lt;!--This controls size of button &amp; title text--&gt;
      &lt;item name="android:textSize"&gt;14sp&lt;/item&gt;
  
      &lt;item name="android:textAppearanceMedium"&gt;@style/MyMsgTextAppearance&lt;/item&gt;
  &lt;/style&gt;
  &lt;style name="MyMsgTextAppearance" parent="@android:style/TextAppearance.Holo.Medium"&gt;
      &lt;item name="android:textSize"&gt;22sp&lt;/item&gt;
      &lt;item name="android:textStyle"&gt;italic&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p>The theme was invoked at runtime using this code:</p>
  
  <pre><code>AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.MyAlertDialogTheme);
  builder.setCancelable(false);
  builder.setTitle("Remove contact");
  builder.setMessage("Are you sure you want to delete this contact ?");
  builder.setPositiveButton("OK", null);
  builder.setNegativeButton("Cancel", null);
  
  AlertDialog dialog = builder.create();
  dialog.show();
  </code></pre>
  
  <p>Here is what I got:
  <a href="https://i.stack.imgur.com/M6rUB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/M6rUB.png" alt="Alert dialog screenshot"></a></p>
  
  <p>Apparently, the message text size is much smaller than 22sp.  I could, however, adjust the font size during runtime:</p>
  
  <pre><code>dialog.show();
  
  TextView tv = (TextView) dialog.findViewById(android.R.id.message);
  if(tv != null)
      tv.setTextSize(22.0f);
  </code></pre>
  
  <p><strong>Update</strong>
  It turns out that if I import <em>android.app.AlertDialog</em>, the message size can be adjusted using this method.  However, if I import <em>android.support.v7.app.AlertDialog</em>, it can't be adjusted using this method.</p>