Hello, guys, how are you? I wonder if it is possible, via the DatePickerDialog, to disable dates that users have chosen? Type, users choose a date in the datepicker that can no longer appear to other users, such as in hairdressing salons, which may not have the same vacancy for two people. I've even gone as far as creating the DatePickerDialog, however, I do not know how to disable these dates after being picked by users.
diaAgendamento= (TextView) findViewById(R.id.textViewDataInicial);
diaAgendamento.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Calendar calendar = Calendar.getInstance();
int dia = calendar.get(Calendar.DAY_OF_MONTH);
int mes = calendar.get(Calendar.MONTH);
int ano = calendar.get(Calendar.YEAR);
DatePickerDialog dialog = new DatePickerDialog(MainActivity.this, android.R.style.Theme_Holo_Dialog_MinWidth, datePicker, dia, mes, ano);
dialog.show();
}
});
datePicker = new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int year, int month, int dayOfMonth) {
month = month + 1;
String date = dayOfMonth + "/" + month + "/" + year;
diaAgendamento.setText(date);
}
};