title: (Java / Android) Calculate days between 2 dates and present the result in a specific format
body: <p>I am trying to do calculate days between 2 dates as follow:</p>
  
  <ol>
  <li>Obtain current date</li>
  <li>Obtain past OR future date</li>
  <li>Calculate the difference between no. 1 and no. 2</li>
  <li>Present the dates in the following format
  <ul>
  <li>If the result is in past (2 day ago) or in the future (in 2 days)</li>
  <li>Format will: days, weeks, months, years</li>
  </ul></li>
  </ol>
  
  <p>I tried different ways but couldn't get the result I wanted above. I found out <strong>that Android <em>DatePicker</em> dialog box convert date into Integer.</strong> I have not found a way to make DatePicket widget to return date variables instead of integer.</p>
  
  <pre><code>private DatePickerDialog.OnDateSetListener mDateSetListener =
          new DatePickerDialog.OnDateSetListener() {
  
              public void onDateSet(DatePicker view, **int** year, 
                                    **int** monthOfYear, **int** dayOfMonth) {
                  enteredYear = year;
                  enteredMonth = monthOfYear;
                  enteredDay = dayOfMonth;
              }
          };
  </code></pre>
  
  <p>I tried to convert the system date to Integer, based on the above, but this doesn't really work when trying to calculate days between 2 dates.</p>
  
  <pre><code>private void getSystemDate(){
       final Calendar c = Calendar.getInstance();
  
          mYear = c.get(Calendar.YEAR);
          systemYear = mYear;
  
          mMonth = c.get(Calendar.MONTH);
          systemMonth = mMonth + 1;
  
          mDay = c.get(Calendar.DAY_OF_MONTH);
          systemDay = mDay;
  
  }
  </code></pre>