java - Android getRelativeTimeSpanString flags not working in other languages than English? -
i'm trying use android helper method dateutils :
public static charsequence getrelativetimespanstring (long time, long now, long minresolution, int flags)
in documentation :
can use format_abbrev_relative flag use abbreviated relative times, "42 mins ago".
but can't find way make format_abbrev_relative work... "42 minutes ago", string never abbreviated.
here code :
dateutils.getrelativetimespanstring( message.getcreationdatetime().gettime(), system.currenttimemillis(), dateutils.minute_in_millis, dateutils.format_abbrev_relative )
can please tell me i'm doing wrong ?
thank in advance.
edit :
in fact, found out working when phone in english, not in french, "i y 42 minutes", long. know solution work on multiple languages ?
what's device language setting? i'm using english (united states) , following code "42 mins ago"
dateutils.getrelativetimespanstring( system.currenttimemillis() - 42 * 60 * 1000, system.currenttimemillis(), dateutils.minute_in_millis, dateutils.format_abbrev_relative)
Comments
Post a Comment