On Android API 19, setting locale to hy, time is displayed as կեսօրից առաջ instead of AM or ԿԱ. The string I get is way too long to fit in the UI. I am displaying time with
<TextClock/>
I am setting the 12h format with this code:
Settings.System.putString(getContentResolver(), Settings.System.TIME_12_24, "12");
I tried running the same code in java fiddle: https://www.mycompiler.io/view/HnfUgdPt9zt Here I get AM as expected. If I try different locale, for example "sl" I get the same result in the java fiddle and in the Android project.
My code:
DateFormat timeOnly = new SimpleDateFormat("h:mm aa", new Locale("hy"));
Date fullDate = new Date();
String callTime = timeOnly.format(fullDate);
I also tried to set AM and PM strings like this:
DateFormatSymbols sym = new DateFormatSymbols(locale);
sym.setAmPmStrings(new String[] {"AM", "PM"});
But I don't know how to apply that format to system time.