AlertDialog原始:
AlertDialog.Builder builder = new AlertDialog.Builder(m_Activity); builder.setTitle("删除提示"); builder.setPositiveButton("确定", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface arg0, int arg1) { //代码片 }); builder.setNegativeButton("取消", null); builder.setIcon(R.drawable.warning); builder.setMessage("确定删除?"); builder.show();
AlertDialog自定义:
AlertDialog.Builder builder = new AlertDialog.Builder(Activity); AlertDialog dialog = builder.create();
View AddView = Activity.getLayoutInflater().inflate(R.layout.xx_layout, null);dialog.setView(AddView, 0, 0, 0, 0); dialog.show();