Как отправить данные о дате и времени в PositiveButton? - PullRequest
1 голос
/ 03 ноября 2019
datepick_event.setOnDateChangedListener(new DatePicker.OnDateChangedListener() {
    @Override
    public void onDateChanged(DatePicker view, int year, int monthOfYear, int dayOfMonth) 
    {
        String a = "Ngày" + dayOfMonth + "tháng" + monthOfYear + "năm" + year;

        TimePickerDialog timePickerDialog = new TimePickerDialog(
            getContext(),
            new TimePickerDialog.OnTimeSetListener() {
                @Override
                public void onTimeSet(TimePicker view, int hourOfDay, int minute) 
                {
                    String b = hourOfDay + ":" + minute;
                }
            }, 
            hour, 
            minute, 
            true);

        timePickerDialog.show();
    }
});

builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
    @Override
    public void onClick(DialogInterface dialog, int which) {

    }
});
...