乔达在某些Android设备上的时间错误? [英] Joda time bug on certain Android devices?

查看:70
本文介绍了乔达在某些Android设备上的时间错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Android应用中使用joda-time 1.6.2,并且收到了一些崩溃报告

I'm using joda-time 1.6.2 in an Android app and I am getting some crash reports

java.lang.IllegalArgumentException: Invalid format: "8:00 AM" is malformed at "AM"

触发代码如下:

DateTimeFormatter formatter = DateTimeFormat.forPattern("hh:mm a");
LocalTime lt = formatter.parseDateTime(value).toLocalTime();

我无法在手机上重现此崩溃,因此它仅在某些Android设备上发生,我不知道为什么.

I can't reproduce this crash on my phones so it happens only on certain Android devices and I have no clue why.

推荐答案

在发布Android 5之后,我也遇到了同样的问题.只有运行此版本的设备才会崩溃.

I was faced with the same issue after the release of Android 5. Only devices running this version would crash.

这可能是本地化问题.看来您的默认本地用户不知道"AM"字符串,但还有其他信息.

This is probably a localization issue. It appears that your default local does not know the "AM"-string, but something else.

有关详细信息和解决方案,请参见我的帖子

这篇关于乔达在某些Android设备上的时间错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆