I am trying to do calculate days between 2 dates as follow:
- Obtain current date
- Obtain past OR future date
- Calculate the difference between no. 1 and no. 2
- Present the dates in the following format
- If the result is in past (2 day ago) or in the future (in 2 days)
- Format will: days, weeks, months, years
 
I tried different ways but couldn't get the result I wanted above. I found out that Android DatePicker dialog box convert date into Integer. I have not found a way to make DatePicket widget to return date variables instead of integer.
private DatePickerDialog.OnDateSetListener mDateSetListener =
        new DatePickerDialog.OnDateSetListener() {
            public void onDateSet(DatePicker view, **int** year, 
                                  **int** monthOfYear, **int** dayOfMonth) {
                enteredYear = year;
                enteredMonth = monthOfYear;
                enteredDay = dayOfMonth;
            }
        };
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.
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;
}
 
     
     
     
    