AlertDialog not showing two buttons.

Posted by jfalexvijay on Stack Overflow See other posts from Stack Overflow or by jfalexvijay
Published on 2011-02-05T06:41:01Z Indexed on 2011/02/05 7:26 UTC
Read the original article Hit count: 200

Filed under:
|

Hi

AlertDialog not showing send button. Below is the code. Please tell me what mistake I have made in my code.

protected Dialog onCreateDialog(int id) {
    final AlertDialog.Builder dialog = new AlertDialog.Builder(this);
    dialog.setMessage("Enter Holla message");
    EditText hollaMessage = new EditText(this);
    dialog.setView(hollaMessage);
    dialog.setCancelable(false);
    dialog.setPositiveButton("Send", new DialogInterface.OnClickListener() {
       public void onClick(DialogInterface dialog, int id) {
          List result = new ArrayList();
       }
    });
    dialog.setPositiveButton("Cancel", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int which) {
            dismissDialog(0);
        }
    });
    AlertDialog alert = dialog.create();
    return alert;
}

© Stack Overflow or respective owner

Related posts about android

Related posts about alertdialog