title: Set date in Date picker
body: <p>I have a date in my button (5-12-2031) when i click the button i want to show date picker with date what i have in my button. In <code>Stackoverflow i found to set the time picker</code><a href="https://stackoverflow.com/questions/12494074/android-setting-time-in-time-picker-with-the-time-shown-in-text-view">Android: Setting time in time picker with the time shown in text view</a> i tried the same but the date picker not shown.</p>
  
  <p>My code is:</p>
  
  <pre><code>Calendar mDateCalender = Calendar.getInstance();
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.add_details_main_layout);
  
  
      date.setOnClickListener(new onClickListener) {
      public void onClick(){
  
      new DatePickerDialog(AddDetailsActivity.this, onDateListener,
                          mDateCalender.get(Calendar.YEAR), mDateCalender.get(Calendar.MONTH),
                          mDateCalender.get(Calendar.DAY_OF_MONTH)).show();
      }
      }
  }
  
  
   DatePickerDialog.OnDateSetListener onDateListener = new OnDateSetListener() {
  
      public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
          date.setText(dayOfMonth + "-" + (monthOfYear + 1) + "-" + year);
  
          String dateFormat = mOfflineDatas.get(0).getOnsket_utfort();
          String[] getDates = dateFormat.split("-");
  
          Toast.makeText(getApplicationContext(), "" + dateFormat, Toast.LENGTH_LONG).show();
  
          mDateCalender.set(Calendar.DAY_OF_MONTH, Integer.valueOf(getDates[0]));
          mDateCalender.set(Calendar.MONTH, Integer.valueOf(getDates[1]));
          mDateCalender.set(Calendar.YEAR, Integer.valueOf(getDates[2]));
  
      }
  };
  </code></pre>
  
  <p>my dateFromat = 5-12-2013 it splits correctly.</p>
  
  <p>What change i need to change in this anybody suggest some ideas..</p>