一、确定/取消对话框
Dialog alertDialog = new AlertDialog.Builder(this). setTitle("提示"). setMessage("你确定要删除?"). setIcon(R.drawable.ic_launcher). setPositiveButton("确定", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub } }). setNegativeButton("取消", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub } }). create(); alertDialog.show();运行效果