Dialog box are powerful tools in android. They have given so much access in dialog box so that we do not need to use spinner. You can create simple Alert Dialog, Custom Alert dialog, Multiple choice, Single choice , Alert Dialog with Base adapter. We easily can create them.
I am going to create All type of dialog boxes with screen shot and source code.
1) Simple Alert Box or Default Alert Box - creating a simple alert dialog is very simple
I am going to create All type of dialog boxes with screen shot and source code.
1) Simple Alert Box or Default Alert Box - creating a simple alert dialog is very simple
private void SimpleAlert() {
Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Simple Alert");
builder.setMessage("This is simple alert box");
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
AlertDialog alert = builder.create();
alert.show();
}
