title: How to make End Date 1 day after the Start Day on android datePicker
body: <p>i have a project that should bring end date after the start date on android datepicker.
  (user will chose any date on start date and  when user click end date what ever user choose end date should be one day after start date)</p>
  <p>for this purpose i have a Kotlin code as in below;</p>
  <pre><code>private fun showDatePickerDialog(type: Int) {
      calendar = Calendar.getInstance()
      year = calendar!!.get(Calendar.YEAR)
      month = calendar!!.get(Calendar.MONTH)
      dayOfMonth = calendar!!.get(Calendar.DAY_OF_MONTH)
      datePickerDialog = DatePickerDialog(
          requireContext(), R.style.MyDatePickerStyle,
          { datePicker, year, month, day -&gt;
              if (type == 0){
                  var month = month + 1
                  var startMonthConverted = &quot;&quot;+month
                  var startDayConverted = &quot;&quot;+day
                  if(month&lt;10){
                      startMonthConverted = &quot;0$startMonthConverted&quot;
                  }
                  if(day&lt;10){
                      startDayConverted= &quot;0$startDayConverted&quot;
                  }
                  binding.txtStartDate.setText(&quot;$year-$startMonthConverted-$startDayConverted&quot;)
              } else {
                  var month = month + 1
                  var monthConverted = &quot;&quot;+month
                  var dayConverted = &quot;&quot;+day
  
                  if(month&lt;10){
                      monthConverted = &quot;0$monthConverted&quot;;
                  }
                  if(day&lt;10){
                      dayConverted = &quot;0$dayConverted&quot;
                  }
                  binding.txtEndDate.setText(&quot;$year-$monthConverted-$dayConverted&quot;)
              }
  
          },
          year,
          month,
          dayOfMonth
      )
      if (type == 0) {
         val startDay = Calendar.getInstance()
          startDay.add(Calendar.DAY_OF_YEAR, 2);
         datePickerDialog!!.datePicker.minDate = startDay.timeInMillis
      } else {
          val endDay = Calendar.getInstance()
          endDay.add(Calendar.DATE, 2)
         // datePickerDialog!!.datePicker.minDate = endDay.timeInMillis
          datePickerDialog!!.getDatePicker().setMinDate(endDay.getTimeInMillis());
      }
      val df: DateFormat = SimpleDateFormat(&quot;'T'HH:mm:ss.SSS&quot;)
      currentTime = df.format(Calendar.getInstance().timeInMillis)
      Log.d(&quot;TAG&quot;, &quot;currentTime:$currentTime &quot;)
      datePickerDialog!!.show()
      //set OK/Cancel buttons color
      //set OK/Cancel buttons color
      datePickerDialog!!.getButton(Dialog.BUTTON_POSITIVE)
          .setTextColor(android.graphics.Color.BLACK)
      datePickerDialog!!.getButton(Dialog.BUTTON_NEGATIVE)
          .setTextColor(android.graphics.Color.BLACK)
  }
  </code></pre>