I'm trying to use this Android helper method from DateUtils :
public static CharSequence getRelativeTimeSpanString (long time, long now, long minResolution, int flags)
In the documentation they say :
Can use FORMAT_ABBREV_RELATIVE flag to use abbreviated relative times, like "42 mins ago".
But I can't find they way to make FORMAT_ABBREV_RELATIVE work... I always get "42 minutes ago", my String is never abbreviated.
Here is my code :
DateUtils.getRelativeTimeSpanString(
message.getCreationDateTime().getTime(),
System.currentTimeMillis(),
DateUtils.MINUTE_IN_MILLIS,
DateUtils.FORMAT_ABBREV_RELATIVE
)
Can you please tell me what I'm doing wrong ?
Thank you in advance.
Edit :
In fact, I found out it is working when my phone is in English, but not in French, I get "I y a 42 minutes", which is very long. Do anyone know a solution that work on multiple languages ?