You'll want to use the
Builder
class on the dialog to create your dialog.
This might work for you;
new AlertDialog.Builder(this)
.setTitle("Dialog Title")
.setMessage("Do you want to do this?")
.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
}
})
.setNegativeButton(android.R.string.no, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
}
})
.show();
You can chain loads of other calls there to set things like icon other things (or not set No button for example).
Hope this helps,
Fredrik