+ Reply to Thread
Results 1 to 2 of 2

Thread: Simple alert dialog

  1. #1

    Simple alert dialog

    I`d like to display a message for user and i`d like to have text , icon and button on it.
    How can i do that ?

  2. #2
    Junior Member
    Join Date
    May 2012
    Posts
    14
    Here is the code for that
    Code:
    AlertDialog AD = new AlertDialog.Builder(this).create();
    AD.setTitle("Message Title");
    AD.setMessage("Message String");
    AD.setButton("OK", new DialogInterface.OnClickListener() {
       public void onClick(DialogInterface dialog, int which) {
          // Add your code for the button here.
    	  // ......
    	  // ......
       }
    });
    // Set the Icon for the Dialog
    AD.setIcon(R.drawable.icon);
    AD.show();

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts