title: How to block only past dates in DatePicker in android
body: <p>how to block only past date in DatePicker in android?
  Am using sample code in that past date and current date getting blocked ,
  I need only past date get blocked not current date here is my code</p>
  
  <pre><code>private DatePickerDialog.OnDateSetListener mDateSetListener =
          new DatePickerDialog.OnDateSetListener() {
  
              public void onDateSet(DatePicker view, int yearSelected,
                                    int monthOfYear, int dayOfMonth) {
                 year = yearSelected;
                 month = monthOfYear;
                 day = dayOfMonth;
                 int n_mon = monthOfYear+1;
  
  
                 business_date_et.setText(day+"-"+n_mon+"-"+year);
              }
          };
  
  
          private TimePickerDialog.OnTimeSetListener mTimeSetListener =
              new TimePickerDialog.OnTimeSetListener() {
  
                  public void onTimeSet(TimePicker view, int hourOfDay, int min) {
                      hour = hourOfDay;
                      minute = min;
  
                      business_time_et.setText(hour+":"+minute);
                    }
              };
  
  
              protected Dialog onCreateDialog(int id) {
                  switch (id) {
                  case DATE_DIALOG_ID:
  
                      DatePickerDialog da = new DatePickerDialog(this, mDateSetListener,
                              mYear, mMonth, mDay);
                      Calendar c = Calendar.getInstance();
  
                      c.add(Calendar.DATE, 1);
                      Date newDate = c.getTime();
                      da.getDatePicker().setMinDate(newDate.getTime());
                      return da;
  
                  case TIME_DIALOG_ID:
                      return new TimePickerDialog(this,
                              mTimeSetListener, mHour, mMinute, false);
  
                  }
                  return null;
              }
  </code></pre>