AlertDialog 예제

SMART_Phone/Android 2011. 1. 31. 22:41 Posted by Request


public AlertDialog getFinishAlertDialog() {
  AlertDialog.Builder builder = new AlertDialog.Builder(this);
  String msg1 = getResources().getText(R.string.upload_cancel_msg1).toString();
  String msg2 = getResources().getText(R.string.upload_cancel_msg2).toString();
  builder.setTitle(getResources().getString(R.string.upload_cancel_title));
  String msg = uploadData.size() + msg1 + " " + (uploadFileCount) + msg2;
  builder.setMessage(msg);
  builder.setPositiveButton(R.string.Yes,
    new DialogInterface.OnClickListener() {
     public void onClick(DialogInterface dialog, int which) {
      isCanceled = true;


      UploadStatusActivity.this.finish();
     }
    });
  builder.setNegativeButton(R.string.No,
    new DialogInterface.OnClickListener() {
     public void onClick(DialogInterface dialog, int which) {
      isCanceled = false;
      resumeUpload();
     }
    });