title: How to get the month and year from the DatePickerDialog?
body: <p><strong>Here's my code:</strong></p>
  
  <pre><code>    public DatePickerDialog CREATE_DATEPICKER_DIALOG() {
          int themeResId = 2;
          datePickerDialog = new DatePickerDialog(this, themeResId, null, 2018, 1, 1);
          datePickerDialog.getDatePicker().setMinDate(get_min_calendar);
          datePickerDialog.getDatePicker().setMaxDate(get_max_calendar);
  
          try {
              // Hide selected day.
              ((ViewGroup) datePickerDialog.getDatePicker()).findViewById(Resources.getSystem().getIdentifier("day", "id", "android")).setVisibility(View.GONE);
              datePickerDialog.updateDate(datePickerDialog.getDatePicker().getYear(), datePickerDialog.getDatePicker().getMonth(), 0);
              datePickerDialog.setTitle("Change Month");
              datePickerDialog.setButton(DialogInterface.BUTTON_POSITIVE, "OK", new DialogInterface.OnClickListener() {
                  @Override
                  public void onClick(DialogInterface dialog, int which) {
                      if(which==DialogInterface.BUTTON_POSITIVE){
                      TXT_MONTH.setText("MONTH_HERE");&lt;----- datePickerDialog.getDatePicker().getMonth();
                      TXT_YEAR.setText("YEAR_HERE");&lt;-----datePickerDialog.getDatePicker().getYear();
                      }else{
  
                      }
                  }
  
              });
          } catch (Exception e) {
              e.printStackTrace();
          }
  
          return datePickerDialog;
  }
  </code></pre>
  
  <p>I used <code>datePickerDialog.getDatePicker().getMonth();</code> and <code>datePickerDialog.getDatePicker().getYear();</code></p>
  
  <p>But it doesn't work. Any kind of help would be appreciated. I just want to get the month and the year using the above DatePickerDialog.</p>
  
  <p>Thanks in advance.</p>