What I'm trying to do is change the default background for the custom DialogFragment dialog that I wrote. I usually do this by modifying the XML layout file, however for DialogFragment these buttons do not exist in the layout file.
In essence, I'm trying to access the setPositiveButton, setNegativeButton, and setNeutral buttons to modify them. Alternatively, I would try to do this by getting them by id, however, since they are not defined in the layout file, I do not have the corresponding identifier for them. I found many examples of how to change the rest of the layout, but I can not find anywhere that the buttons with positive / neutral / negative can be modified.
Ideally, I could do this in the following block of code:
.setPositiveButton(R.string.add, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
...
}
})
Thanks in advance.
source
share