Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If I understand your question properly I think you should do this in the <code>OnDateSetListener</code> for your start date picker. </p> <p>Use the code suggested by blackbelt to add one day to the date passed into the <code>onDateSet</code> method and use this new Calendar instance in the <code>updateDisplay</code> method for your endDatePicker</p> <p>Here is a quick example that you can adapt to your code</p> <pre><code> Button startDateButton = (Button)findViewById(R.id.start_date_button); Button endDateButton = (Button)findViewById(R.id.end_date_button); Calendar cal = Calendar.getInstance(); _endDateListener = new DatePickerDialog.OnDateSetListener() { @Override public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) { //Do what ever you need to do in the end date listener } }; _startDateListener = new DatePickerDialog.OnDateSetListener() { @Override public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) { Calendar cal = Calendar.getInstance(); cal.set(year, monthOfYear, dayOfMonth); cal.add(Calendar.DATE, 1); _endDateDialog = new DatePickerDialog(_context, _endDateListener, cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH)); } }; _startDateDialog = new DatePickerDialog(this, _startDateListener, cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH)); _endDateDialog = new DatePickerDialog(this, _endDateListener, cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH)); startDateButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { _startDateDialog.show(); } }); endDateButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { _endDateDialog.show(); } }); </code></pre> <p>Hopefully this has made it clear for you</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload