title: DatePickerDialog resets the date in Android
body: <p>I am using <code>datePickerDialog</code> in my application. I have set <strong>current date</strong> and <code>onClickListener</code> both on a same <code>textView</code></p>
  
  <p>Initially textView displays current date and when it listens click event, it shows a <code>DatePickerDialog</code> </p>
  
  <p><strong>What is my problem?</strong></p>
  
  <p>When I tap on <code>textView</code> it shows me <code>DatePicker</code> with <strong>current date</strong>, then I set any date, new date is now visible on textView <strong>but</strong> every time I tap on textView it shows <strong>current date</strong> in <code>datePickerDialog</code>, I want the <code>datepicker</code> to <strong>update</strong> the date on <code>datePickerDialog</code> also. </p>
  
  <p>Here is my <code>Activity.java</code> snippet</p>
  
  <pre><code>final Calendar c = Calendar.getInstance();
  mYear = c.get(Calendar.YEAR);
  mMonth = c.get(Calendar.MONTH);
  mDay = c.get(Calendar.DAY_OF_MONTH);
  
  //format of the current date
  String currDate = new SimpleDateFormat("MM/dd/yyyy").format(new Date());
  
  //set current date on textView
  dateView = (TextView) findViewById(R.id.date_view);
  dateView.setText(currDate);
  
  dateView.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View view) {
          DatePickerDialog dpd = new DatePickerDialog(TRTimeReminder.this,
                  new DatePickerDialog.OnDateSetListener() {
                      @Override
                      public void onDateSet(DatePicker view, int year, int month, int day) {
                          c.set(year, month, day);
                          String date = new SimpleDateFormat("MM/dd/yyyy").format(c.getTime());
                          dateView.setText(date);
                      }
                  }, mYear, mMonth, mDay);
              dpd.show();
          }
      });
  </code></pre>
  
  <h1>Edit</h1>
  
  <p>I also updated <code>DatePickerDialog(TRTimeReminder.this,.....,mYear, mMonth, mDay)</code> to <code>DatePickerDialog(TRTimeReminder.this,....., y, m, d)</code></p>
  
  <p>where <code>int y, m, d</code> are variables I defined inside <code>onDateSet()</code> method as <code>y = year, m = month, d = day</code> but when I tap textView it shows initialized date <strong>JAN 1 1900</strong></p>