Is it possible to right-justify the text in an AlertDialog\'s title and message?
I am showing Hebrew messages but they are showing up left justified.
For setting layout direction of alert dialog to RTL you can use OnShowListener method. after setting title , message , .... use this method.
dialog = alertdialogbuilder.create();
dialog.setOnShowListener(new DialogInterface.OnShowListener() {
@Override
public void onShow(DialogInterface dlg) {
dialog.getButton(Dialog.BUTTON_POSITIVE).setTextSize(20); // set text size of positive button
dialog.getButton(Dialog.BUTTON_POSITIVE).setTextColor(Color.RED); set text color of positive button
dialog.getWindow().getDecorView().setLayoutDirection(View.LAYOUT_DIRECTION_RTL); // set title and message direction to RTL
}
});
dialog.show();