title: Android: Getting previous date in DatePickerDialog
body: <p>i'm successfully displaying the DatePickerDialog with restricting the previous date by using <code>datePickerDialog.getDatePicker().setMinDate(System.currentTimeMillis());</code>. In this case it not activating the previous dates and restricting the previous months but user still able to select the previous date of present month (For understanding see the image and code)</p>
  
  <p><a href="https://i.stack.imgur.com/5c82K.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5c82K.png" alt="enter image description here"></a></p>
  
  <pre><code>etDate.setOnClickListener(new OnClickListener() {
  
          @Override
          public void onClick(View v) {
  
              final Calendar mcurrentDate = Calendar.getInstance();
              int mYear = mcurrentDate.get(Calendar.YEAR);
              int mMonth = mcurrentDate.get(Calendar.MONTH);
              int mDay = mcurrentDate.get(Calendar.DAY_OF_MONTH);
  
  
              DatePickerDialog datePickerDialog = new DatePickerDialog(EventMyEventEdit.this, new OnDateSetListener() {
  
                  @Override
                  public void onDateSet(DatePicker view, int year, int monthOfYear,
                          int dayOfMonth) {
                       mcurrentDate.set(Calendar.YEAR, year);
                       mcurrentDate.set(Calendar.MONTH, monthOfYear);
                       mcurrentDate.set(Calendar.DAY_OF_MONTH,dayOfMonth);
                       String myFormat = "dd/MM/yy";
                       SimpleDateFormat sdf = new SimpleDateFormat(myFormat, Locale.US);
  
                       etDate.setText(sdf.format(mcurrentDate.getTime()));
  
                  }
              }, mYear, mMonth, mDay);
  
              datePickerDialog.getDatePicker().setMinDate(System.currentTimeMillis());
  
              datePickerDialog.show();
  
          }
      });
  </code></pre>
  
  <p>Edit: I want to restrict the user when selecting the previous dates than the present date </p>