title: Android:Cannot set current date each time to date picker
body: <p>I am using <code>DatePicker</code> to show the date to the user in my application.
      However, I am using <strong>onCreateDialog</strong> method to show the date picker to the user, setting the integer variable as follows:
      <strong>static final int DATE_DIALOG_ID = 999;</strong>
      Then I am calling below method
      <strong>showDialog(DATE_DIALOG_ID);</strong></p>
  
  <p>First time the date picker initialized with current date. Everything is fine till now.</p>
  
  <pre><code>@Override
      protected Dialog onCreateDialog(int id) {
          Calendar c = Calendar.getInstance();
          final int myear = c.get(Calendar.YEAR);
          final int mmonth = c.get(Calendar.MONTH);
          final int mday = c.get(Calendar.DAY_OF_MONTH);
          Log.d("Executed", "hihihihihihihi");
          switch (id) {
              case DATE_DIALOG_ID:
                  // set date picker as current date
                  DatePickerDialog _date = new DatePickerDialog(this, AlertDialog.THEME_HOLO_LIGHT, datePickerListener, myear, mmonth,
                          mday) {
  
  
  
                      @Override
                      public void onDateChanged(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
                          if (year &lt; myear)
                              view.updateDate(myear, mmonth, mday);
  
                          if (monthOfYear &lt; mmonth &amp;&amp; year == myear)
                              view.updateDate(myear, mmonth, mday);
  
                          if (dayOfMonth &lt; mday &amp;&amp; year == myear &amp;&amp; monthOfYear == mmonth)
                              view.updateDate(myear, mmonth, mday);
  
                      }
  
                  };
                  return _date;
  
          }
          return null;
      }
  </code></pre>
  
  <p>But the problem is when i selects date other than current date it works.but when i again tries to select date the date picker by default shows me last selected date.I am unable to set current date each time when  date picker opens so how can i do this</p>