AlertDialog with background

0

I created this alertDialog but I would like to know if instead of having an icon when it appears, if it is possible it has another color or even use an image as its (Background). And Assign the buttons a background.

public void icon (View View){
        AlertDialog.Builder dialog = new AlertDialog.Builder (this);
        dialog.setMessage("Exemplo com icon");
        dialog.setPositiveButton("NEXT", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                setContentView(R.layout.next);
            }
        });
        dialog.setTitle("Icone");
        dialog.setIcon(R.drawable.buttonum);
        dialog.show();
    }
    
asked by anonymous 09.12.2016 / 15:15

1 answer

2

You can create a layout.xml and additional to AlertDialog

final AlertDialog dialog = new AlertDialog.Builder(suaActivity.this)
                    .setView(R.layout.seulayout)
                    .create();
    
09.12.2016 / 19:56