title: how to set android datepicker dialog max date to current date?
body: <p>I'm new to android and tried every thing to set datepicker dialog max date to current date. Done R &amp; D but didn't succeed. Please some one help me in this. Thanks in advance</p>
  
  <p>Here is the code:</p>
  
  <pre><code>  Calendar myCalendar;
    DatePickerDialog.OnDateSetListener date;
  
    dobET = (EditText) findViewById(R.id.dobET);
    myCalendar = Calendar.getInstance();
  
      date = new DatePickerDialog.OnDateSetListener() {
  
          @Override
          public void onDateSet(DatePicker view, int year, int monthOfYear,
                  int dayOfMonth) {
              // TODO Auto-generated method stub
              myCalendar.set(Calendar.YEAR, year);
              myCalendar.set(Calendar.MONTH, monthOfYear);
              myCalendar.set(Calendar.DAY_OF_MONTH, dayOfMonth);
              updateLabel();
          }
      };
  
      dobET.setOnClickListener(new OnClickListener() {
  
          @Override
          public void onClick(View v) {
              // TODO Auto-generated method stub
              new DatePickerDialog(ChangeProfileActivity.this, date,
                      myCalendar.get(Calendar.YEAR), myCalendar
                              .get(Calendar.MONTH), myCalendar
                              .get(Calendar.DAY_OF_MONTH)).show();
  
          }
      });
  </code></pre>