title: Set End datepicker Minimum date is More than Start Datepicker selected date in android not Working
body: <p>I want to show the <strong>End mimimum Date value</strong> is not Less  than selected Date in <strong>Start Date value</strong> </p>
  
  <p>But in my code is showing <strong>end date Min value</strong> is from today's date.</p>
  
  <p>help me ,How to solve it.</p>
  
  <p>// for date picker show</p>
  
  <pre><code>@Override
  protected Dialog onCreateDialog(int id) {
  
      switch (id) {
          case DATE_PICKER_ID:
  
              // open datepicker dialog.
              // set date picker for current date
              // add pickerListener listner to date picker
              return new DatePickerDialog(this, pickerListener1, Startyear, Startmonth, Startday);
  
          case DATE_PICKER_ID1:
  
              // open datepicker dialog.
              // set date picker for current date
              // add pickerListener listner to date picker
              //return new DatePickerDialog(this, pickerListener2, Startyear, Startmonth, Startday);
  
  
         // set minimum date of end datepicker
  
              DatePickerDialog dialog = new DatePickerDialog(this, pickerListener2, Startyear, Startmonth, Startday);
  
  
              Calendar c = Calendar.getInstance();
              c.set(Startyear1new, Startmonth1new, Startday1new);
              dialog.getDatePicker().setMinDate(c.getTimeInMillis()-10000);
          return dialog;
  
  
      }
      return null;
  }
  
  private DatePickerDialog.OnDateSetListener pickerListener1 = new DatePickerDialog.OnDateSetListener() {
  
      // when dialog box is closed, below method will be called.
      @Override
      public void onDateSet(DatePicker view, int selectedYear,
                            int selectedMonth, int selectedDay) {
  
          Startyear = selectedYear;
          Startmonth = selectedMonth;
          Startday = selectedDay;
  
  
  
          // Show selected date
          StringBuilder dateValue=new StringBuilder().append(Startday).append("-")
                  .append(Startmonth + 1).append("-").append(Startyear).append(" ");
  
          //for Converting Correct Date format Save into Database
          SimpleDateFormat sdf123 = new SimpleDateFormat("dd-MM-yyyy");
          String abs1= dateValue.toString();
          Date testDate1 = null;
          try {
              testDate1 = sdf123.parse(abs1);
          } catch (ParseException e) {
  
              e.printStackTrace();
          }
          SimpleDateFormat formatter1 = new SimpleDateFormat("dd-MM-yyyy");
          String DateFormat=formatter1.format(testDate1);
          CampStartDateEdittext_datepicker.setText(DateFormat);
  
  
      }
  };
  
  private DatePickerDialog.OnDateSetListener pickerListener2 = new DatePickerDialog.OnDateSetListener() {
  
      // when dialog box is closed, below method will be called.
      @Override
      public void onDateSet(DatePicker view, int selectedYear,
                            int selectedMonth, int selectedDay)
      {
  
          Endyear = selectedYear;
          Endmonth = selectedMonth;
          Endday = selectedDay;
  
  
          // Show selected date
          StringBuilder dateValue=new StringBuilder().append(Endday).append("-")
                  .append(Endmonth + 1).append("-").append(Endyear).append(" ");
  
  
          //for Converting Correct Date format Save into Database
          SimpleDateFormat sdf123 = new SimpleDateFormat("dd-MM-yyyy");
          String abs1= dateValue.toString();
          Date testDate23 = null;
          try {
              testDate23 = sdf123.parse(abs1);
          } catch (ParseException e) {
  
              e.printStackTrace();
          }
          SimpleDateFormat formatter1 = new SimpleDateFormat("dd-MM-yyyy");
          String DateFormat=formatter1.format(testDate23);
  
          Camp_EndDateEdittext_datepicker.setText(DateFormat);
  
  
      }
  };
  </code></pre>