I'm using this code:
@Override
protected void onResume() {
super.onResume();
AlertDialog d = new AlertDialog.Builder(this)
.setTitle("This is the Dialog Title")
.setMessage("This is the Test message")
.setPositiveButton("Positive Button", (dialog, which) -> {
dialog.dismiss();
})
.create();
rotateDialog(d);
d.show();
}
public static void rotateDialog(Dialog curDlg) {
Window window = curDlg.getWindow();
if (window != null) {
View decorView = window.getDecorView();
decorView.setRotation(-90);
}
}
Before rotation, the Dialog looks correctly. But after rotation, it is cropped on Emulator. (DecorView is visualized using LayoutInspector).
What code should be used to rotate an AlertDialog correctly?
