I'm learning Android and i'm trying to avoid this behavior on my app.
This is the result using setMessage on the dialog.
This is the result using setTittle on the dialog.
Is there a way to avoid that the text or the radioButtons gets cut when i change orientation to horizontal ?
I'm using the a custom layout (LinearLayout) with this Alert Dialog for displaying the radioButtons.
I'm also using onCreateDialog to create the Alert Dialog .
@Override
protected Dialog onCreateDialog(int id) {
Dialog createdDialog;
AlertDialog.Builder builder = new AlertDialog.Builder(this);
toDisplayInDialog = getLayoutInflater().inflate(R.layout.light_radiogroup, null);
builder.setTitle("Choose Startup Color:")
.setPositiveButton("Set Color",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// Do things on Click
}
})
.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
})
.setView(toDisplayInDialog);
createdDialog = builder.create();
return createdDialog;
}