/**添加事项对话框*/
LayoutInflater inflater = LayoutInflater.from(PropertySetActivity.this);
final View textEntryView = inflater.inflate(R.layout.alert_dialog_text_entry, null);
final EditText eventNameET = (EditText)textEntryView.findViewById(R.id.eventNameET);
new AlertDialog.Builder(PropertySetActivity.this)
.setIcon(R.drawable.alert_dialog_icon)
.setTitle("亲,请添加×××事项名称")
.setView(textEntryView)
.setPositiveButton("确定", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
eventName = eventNameET.getText().toString();
}
})
.setNegativeButton("取消", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
Toast.makeText(PropertySetActivity.this, "亲,您没有对×××事项命名!", Toast.LENGTH_SHORT).show();
}
})
.show();
/**添加事项对话框*/
转载于:https://blog.51cto.com/chinesefys/974201