Hi Friends, if you like my blog please give your valuable comments it will help to improve my blog content and enthusiasm to write a lot in android World.

Friday, April 12, 2013

Simple Alert Popup with Title, Message, Icon and Button

AlertDialog alertDialog = new AlertDialog.Builder(this).create();
 alertDialog.setTitle("Title");
 alertDialog.setMessage("Message");
 alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
 public void onClick(DialogInterface dialog, int which) {
 // TODO Add your code for the button here.
 } });
 // Set the Icon for the Dialog
 alertDialog.setIcon(R.drawable.icon);
alertDialog.show();

No comments:

Post a Comment