title: Android difference between two dates?
body: <p>I getting two date from calendars.It writing into a string builder.I want to getting difference between two date also I want to keep the number of days remaining between times,except weekends.</p>
  
  <pre><code> private DatePickerDialog.OnDateSetListener datePickerListener = new DatePickerDialog.OnDateSetListener() {
  
          // when dialog box is closed, below method will be called.
          public void onDateSet(DatePicker view, int selectedYear,  int selectedMonth, int selectedDay) {
  
  
              year = selectedYear;
              month = selectedMonth;
              day = selectedDay;
  
              if (cur == DATE_DIALOG_ID) {
                  // set selected date into textview
                 permitDate = new StringBuilder().append(day).append(".").append(month + 1).append(".").append(year).append(" ").toString();
                  tvDisplayDate.setText("Date : " + permitDate);
  
              } else {
                 startDate = new StringBuilder().append(day).append(".").append(month + 1) .append(".").append(year).append(" ").toString();
                  tvDisplayDate2.setText("Date : " + startDate);
  
  
              }
  
          }
      };
  </code></pre>