Android DialogFragment title not showing

Solved by adding the following to the styles.xml:

<item name="android:dialogTheme">@style/CustomDialog</item>

<style name="CustomDialog" parent="@style/Theme.AppCompat.Light.Dialog">
    <item name="android:windowNoTitle">false</item>
</style>

In your styles:

<style name="CustomDialog" parent="@style/Theme.AppCompat.Light.Dialog">
    <item name="android:windowNoTitle">false</item>
</style>

If your dialog is a fragment:

MyFragment myFragment = new MyFragment();
myFragment.setStyle(DialogFragment.STYLE_NORMAL, R.style.CustomDialog);