I have a class that opens a very simple AlertDialog
with:
new AlertDialog.Builder(this)
.setIcon(android.R.drawable.ic_dialog_alert)
.setTitle(TITLE)
.setMessage(MESSAGE)
.setPositiveButton("YES", (dialog, which) -> {
f.delete();
})
.setNegativeButton("CANCEL", null)
.show();
This class is called twice in my app, in different activities.
The problem is that the button layout is different depending on the activity: in one, the buttons are big filling the parent (this is what I want). In the other, they are small and left justified.
Why is this? Shouldn't be the same, being the same method on the same class? Is the containing activity influencing the behavior? How should I fix this without fancy calling layoutparameters on the AlertDialog?
Is the containing activity influencing the behavior?
it can, it depends on your styles and themesR.style.MyAlertDialog
. Thanks!