title: How to get date "value" from DatePicker?
body: <p>I don't know how to get the date value from Datepicker. </p>
  
  <pre><code>PickerDialog.java
  
  package com.example.alecksjohanssen.newyorktimes;
  
  /**
   * Created by AlecksJohanssen on 3/19/2016.
   */
  import android.app.DatePickerDialog;
  import android.app.Dialog;
  import android.app.DialogFragment;
  import android.os.Bundle;
  
  import java.util.Calendar;
  
  public class PickerDialog extends DialogFragment {
      @Override
      public Dialog onCreateDialog(Bundle savedInstanceState)
  
      {   DateSettings dateSettings = new DateSettings(getActivity());
          Calendar calendar = Calendar.getInstance();
          int year = calendar.get(Calendar.YEAR);
          int month = calendar.get(Calendar.MONTH);
          int dayofmonth = calendar.get(Calendar.DAY_OF_MONTH);
          DatePickerDialog dialog;
          dialog = new DatePickerDialog(getActivity(),dateSettings,year,month,dayofmonth);
          return dialog;
      }
  }
  DateSetting.java
  package com.example.alecksjohanssen.newyorktimes;
  
  import android.app.DatePickerDialog;
  import android.content.Context;
  import android.widget.DatePicker;
  import android.widget.Toast;
  
  /**
   * Created by My name Is Hardline on 2/26/2016.
   */
  public class DateSettings implements DatePickerDialog.OnDateSetListener {
      Context context;
  
      public DateSettings(Context context) {
  
          this.context = context;
  
      }
  
      @Override
      public void onDateSet(DatePicker view, int year, int monthofyear,int dayofmonth) {
          Toast.makeText(context, "Selected date" + monthofyear + "/" + dayofmonth + "/" + year, Toast.LENGTH_LONG).show();
      }
  }
  
  
    public void setDate() {
          PickerDialog pickerDialogs = new PickerDialog();
          pickerDialogs.show(getFragmentManager(), "date_picker");
      }
  </code></pre>
  
  <p>It's basically it, it's only shows that Selected date is . Still I'm looking for how to extract the date data so that I can put it on my Begin Date :P.</p>