1

I hope to get a dialog just like a.png, but the following code can't create the UI just like a.png. How can I do? Thanks!

a.png

AlertDialog.Builder builder = new Builder(this);
builder.setMessage("The operation will spend long time!");
builder.setTitle(getString(R.string.Warning));
builder.setMultiChoiceItems(new String[] { "Don't display the message again" }, null, null);
builder.setPositiveButton(getString(R.string.OK), new DialogInterface.OnClickListener() {
    public void onClick(DialogInterface dialog, int which) {
    }
});

builder.create().show();    

1 Answer 1

3

Can AlertDialog display a message with checkbox dialog?

for showing any View in AlertDialog you should need to create custom layout for Dialog screen instead of using default see below example for creating custom AlertDialog :

Android prompt user input dialog example

Customize AlertDialog

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.