DatePickerDialog添加确认和取消按钮


DatePickerDialog picker = new DatePickerDialog(MainActivity.this, DatePickerListener,
                iYear, iMonth, iDay);
        picker.setCancelable(true);
        picker.setCanceledOnTouchOutside(true);
        picker.setButton(DialogInterface.BUTTON_POSITIVE, "OK",
                new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        Log.d("Picker""Correct behavior!");
                    }
                });
        picker.setButton(DialogInterface.BUTTON_NEGATIVE, "Cancel",
                new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        Log.d("Picker""Cancel!");
                    }
                });
        picker.show();
展开阅读全文

没有更多推荐了,返回首页