If you use an AlertDialog Builder, create a layout for your dialog title (in which you can center the text for example), inflate it and give it to the builder. Like so :
res/layout/dialog_title.xml :
<TextView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/colorPrimaryDark_rc" android:textSize="22sp" android:gravity="center" android:textColor="@color/textColorPrimaryDark" android:padding="10dp"/>
Java:
public Dialog onCreateDialog(Bundle savedInstanceState) { AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(act); LayoutInflater layoutInflater = act.getLayoutInflater(); View customView = layoutInflater.inflate(R.layout.l_df_episode_details, null); alertDialogBuilder.setView(customView); TextView tv = (TextView) layoutInflater.inflate(R.layout.dialog_title, null); tv.setText("YOUR TITLE"); alertDialogBuilder.setCustomTitle(tv); ...... alertDialog = alertDialogBuilder.create(); return alertDialog; }