I created a datepicker using DatePickerFragment
in android.
Below is my code,
@OnClick(R.id.add_info_food_date_edit)
public void setDate() {
DatePickerFragment datePickerFragment = new DatePickerFragment();
datePickerFragment.setCallbackListener(new DatePickerFragment.onDatePickerListener() {
@Override
public void onDataSet(int year, int month, int day) {
int currentMonth = 0;
if (month == 0) {
currentMonth = 1;
} else if (month == 1) {
currentMonth = 2;
} else if (month == 2) {
currentMonth = 3;
} else if (month == 3) {
currentMonth = 4;
} else if (month == 4) {
currentMonth = 5;
} else if (month == 5) {
currentMonth = 6;
} else if (month == 6) {
currentMonth = 7;
} else if (month == 7) {
currentMonth = 8;
} else if (month == 8) {
currentMonth = 9;
} else if (month == 9) {
currentMonth = 10;
} else if (month == 10) {
currentMonth = 11;
} else if (month == 11) {
currentMonth = 12;
} else if (month == 12) {
}
dateEditText.setText(day + "/" + currentMonth + "/" + year);
}
});
DialogFragment datePicker = datePickerFragment;
datePicker.show(getSupportFragmentManager(), "datePicker");
}
Now I want to disable future days in this datepicker without destroying this code . Still I haven't any good thought about the change. How can I accomplish this.
Have any ideas ?