Android datepicker get date
<p>I placed a datepicker on a layout to let the user select their birthday. I have used datepickerdialogs earlier by clicking on a button and bringing the dialog up. But this time the datepicker itself is on the layout and I can select a date. How can I get the date every time the user changes the day, month or the year? </p>

<p><img src="http://i.stack.imgur.com/4gsp2.png" alt="enter image description here"></p>

<p><strong>Solution:</strong></p>

<pre><code>dpResult = (DatePicker) findViewById(R.id.dpResult);

dpResult.init(year, month, day, new OnDateChangedListener() {
    @Override
    public void onDateChanged(DatePicker view, int year, int monthOfYear,int dayOfMonth) {

           //here I got all the values I need
    }
    });
</code></pre>
