android开发创建一个简单的自定义对话框

释放双眼,带上耳机,听听看~!
AlertDialog.Builder customizeDialog = new AlertDialog.Builder(context);
final View dialogView = LayoutInflater.from(context).inflate(R.layout.dialog_customize, null);
customizeDialog.setTitle("标题");
customizeDialog.setView(dialogView);
customizeDialog.setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
final EditText edit_text = (EditText) dialogView.findViewById(R.id.edit_text);
final String str = edit_text.getText().toString();
edit_text.setText(nameList.get(position).toString());
nameList.remove(position);
nameList.add(position, str);
adapter.notifyDataSetChanged();
}
});
customizeDialog.setNegativeButton("取消", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
customizeDialog.show();

 

人已赞赏
Android文章

Android开发将List转化为JsonArray和JsonObject

2020-1-23 10:58:35

Android文章

android开发在selector中同时设置button的圆角和点击效果,简单颜色无需美工

2020-1-24 6:29:06

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
有新消息 消息中心
搜索