I\'m new to android How to do disable future date in date picker, I tried many codes in stack over flow but it couldn\'t help.can anybody help me pleas.
Have a look
I use this code in my project:
Calendar calendar = Calendar.getInstance();
calendar.set(year,monthOfYear,dayOfMonth);
long selectedTimeInMillis = calendar.getTimeInMillis();
long systemTimeInMillis = Calendar.getInstance().getTimeInMillis();
if(selectedTimeInMillis<=systemTimeInMillis){
setDate(year,monthOfYear,dayOfMonth);
}else{
Toast.makeText(getContext(),"Cannot select future date",Toast.LENGTH_SHORT).show();
}