title: DatePicker not showing
body: <p>I am trying to create a popup date picker from a button (the button that pops it up also shows the date). However the popup isn't showing. When the button is pressed nothing happens.</p>
  
  <p>The DatePicker needs to be casted from an xml since I want it to show as spinners not a calendar (and from what I've read after API 21 the only way to do that is in xml)</p>
  
  <p>Here is my code for the onClickLlistner for the button:</p>
  
  <pre><code>final Button startDate = (Button)findViewById(R.id.startDate);
  Calendar currentDate = Calendar.getInstance();
  mYear = currentDate.get(Calendar.YEAR);
  mMonth = currentDate.get(Calendar.MONTH);
  int mDay = currentDate.get(Calendar.DAY_OF_MONTH);
  
  startDate.setText(mMonth + "/" + mDay + "/" + mYear);
  
  startDate.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
  
              //get date from button text
              Calendar dateInButton = Calendar.getInstance();
              SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd", Locale.US);
              try {
                  dateInButton.setTime(sdf.parse(startDate.getText().toString()));
              } catch (ParseException e) {
                  e.printStackTrace();
              }
              int pYear = dateInButton.get(Calendar.YEAR);
              int pMonth = dateInButton.get(Calendar.MONTH);
              int pDay = dateInButton.get(Calendar.DAY_OF_MONTH);
  
              //display popup datepicker
              final View dialogView = View.inflate(MyActivity.this, R.layout.date_picker, null);
  
              DatePicker datePicker = (DatePicker) dialogView.findViewById(R.id.date_picker);
              datePicker.updateDate(pYear, pMonth, pDay);
              datePicker.init(pYear, pMonth, pDay, new DatePicker.OnDateChangedListener() {
                  @Override
                  public void onDateChanged(DatePicker view, int year, int month, int day) {
                      month++;
                      startDate.setText(month + "/" + day + "/" + year);
                  }
              });
  
          }
      });
  </code></pre>