My app has a 0 - 120 minute picker. I want to display the time like this: "In ... minutes".
I found the method DateUtils#getRelativeTimeSpanString(long, long, long)
and it works correctly for values under 60 minutes. However, if the value is 60 minutes or higher it displays it as "In 1 hour" instead of "In 120 minutes".
This is the code I'm using:
int minutes = 70;
long millis = minutes * 60 * 1000;
String text = DateUtils.getRelativeTimeSpanString(millis, 0L, DateUtils.MINUTE_IN_MILLIS);
myTextView.setText(text); // Displays "In 1 hour" instead of "In 70 minutes".
How can I force the output to be in minutes?