19 thg 5, 2011

Tao Alert Dialog with OK and Cancel options Trong Android



Alert Dialog with OK and Cancel options

 AlertDialog.Builder myAlertDialog = new AlertDialog.Builder(AndroidAlertDialog.this);
 myAlertDialog.setTitle("--- Title ---");
 myAlertDialog.setMessage("Alert Dialog Message");
 myAlertDialog.setPositiveButton("OK", new DialogInterface.OnClickListener() {

  public void onClick(DialogInterface arg0, int arg1) {
  // do something when the OK button is clicked
  }});
 myAlertDialog.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
       
  public void onClick(DialogInterface arg0, int arg1) {
  // do something when the Cancel button is clicked
  }});
 myAlertDialog.show();
(Suu tam). 

1 nhận xét:

Bản beta đầu tiên

Sau 6 tháng cả team cặm cụi làm việc điên cuồng, bản alpha cũng được giới thiệu ra toàn bộ công ty và được testing nội bộ công ty mà thôi. ...