Android: setMinDate with two DatePicker
<p>i have to setMinDate with today in one DatePicker, and in second DatePicker i have to setMinDate with the previous date selected.
I tried to search on internet but all the things that i tried didn't work.
Can someone help me to solve this problem??</p>

<p>Thanks to every helps.</p>

<pre><code>@Override
public void onClick(View view) {
    if(view == dataInizioCoupon) {
        fromDatePickerDialog.show();
    } else if(view == dataFineCoupon) {
        toDatePickerDialog.show();
    }

}

private void findViewsById() {

    dataInizioCoupon = (EditText) findViewById(R.id.textNuovoCouponDataInizio);
    dataInizioCoupon.setInputType(InputType.TYPE_NULL);
    dataInizioCoupon.requestFocus();

    dataFineCoupon = (EditText) findViewById(R.id.textNuovoCouponDataFine);
    dataFineCoupon.setInputType(InputType.TYPE_NULL);
}

private void setDateTimeField() {
    dataInizioCoupon.setOnClickListener(this);
    dataFineCoupon.setOnClickListener(this);

    Calendar newCalendar = Calendar.getInstance();

    fromDatePickerDialog = new DatePickerDialog(this, new DatePickerDialog.OnDateSetListener() {

        public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
            Calendar newDate = Calendar.getInstance();
            newDate.set(year, monthOfYear, dayOfMonth);
            dataInizioCoupon.setText(dateFormatter.format(newDate.getTime()));
        }

    },newCalendar.get(Calendar.YEAR), newCalendar.get(Calendar.MONTH), newCalendar.get(Calendar.DAY_OF_MONTH));

    toDatePickerDialog = new DatePickerDialog(this, new DatePickerDialog.OnDateSetListener() {

        public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
            Calendar newDate = Calendar.getInstance();
            newDate.set(year, monthOfYear, dayOfMonth);

            dataFineCoupon.setText(dateFormatter.format(newDate.getTime()));
        }

    },newCalendar.get(Calendar.YEAR), newCalendar.get(Calendar.MONTH), newCalendar.get(Calendar.DAY_OF_MONTH));

}
</code></pre>