timeofmark = calendar.getinstance(locale.english); map<string, integer> = timeofmark.getdisplaynames(calendar.hour, calendar.short, locale.english); for(map.entry<string, integer> pair : what.entryset()) { log.e(pair.getkey(), integer.tostring(pair.getvalue())); }
this case crashes android app, because log.e cannot accept null string.
it same thing with
timeofmark.getdisplayname(calendar.hour, calendar.short, locale.english);
i tried many variations input parameters. locale did locale.getdefault() , many other. still same **
no darn luck. there solve this? or easy workaround?
public map getdisplaynames(int field,int style,locale locale)
this method returns map containing display names in style , locale , field values, or null
if no string representation available.
timeofmark.getdisplayname(calendar.hour, calendar.short, locale.english);
there not string representation of hour, i.e can express hours
in string
did month , day_of_week
try week, month example
map< string, integer> representations = now.getdisplaynames(calendar.month, calendar.all_styles, locale);
you get
{apr=3, april=3, aug=7, august=7, dec=11, december=11, feb=1, february=1, jan=0, january=0, jul=6, july=6, jun=5, june=5, mar=2, march=2, may=4, nov=10, november=10, oct=9, october=9, sep=8, september=8}
for calendar.day_of_week
{fri=6, friday=6, mon=2, monday=2, sat=7, saturday=7, sun=1, sunday=1, thu=5, thursday=5, tue=3, tuesday=3, wed=4, wednesday=4}
try here
Comments
Post a Comment