找不到 Joda 时间资源错误
Joda Time resource not found error
我正在尝试获取一个字符串并将其转换为另一个更具可读格式的字符串:
String startTime = invite.get_start_time();
Log.d(LOG_TAG, "String to be converted is " + startTime);
DateTimeFormatter fmt = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss");
DateTime dt = fmt.parseDateTime(startTime);
invite.set_start_time(dt.toString("MM dd yyyy hh:mmaa"));
08-02 14:33:19.011: D/InvitesObjectListAdapter(856): String to be
converted is 2015-08-03 10:30:00 08-02 14:33:19.041:
W/System.err(856): java.io.IOException: Resource not found:
"org/joda/time/tz/data/ZoneInfoMap" ClassLoader:
dalvik.system.PathClassLoader[DexPathList[[zip file
"/data/app/me.lunchbunch.core-1/base.apk"],nativeLibraryDirectories=[/vendor/lib64,
/system/lib64]]]
有人知道这个错误是从哪里来的吗?
抱歉浪费了人们的时间,@adelphus 是正确的 - 我没有初始化:
JodaTimeAndroid.init(this);
它在我的代码中,但我需要重构以确保它被命中。
我正在尝试获取一个字符串并将其转换为另一个更具可读格式的字符串:
String startTime = invite.get_start_time();
Log.d(LOG_TAG, "String to be converted is " + startTime);
DateTimeFormatter fmt = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss");
DateTime dt = fmt.parseDateTime(startTime);
invite.set_start_time(dt.toString("MM dd yyyy hh:mmaa"));
08-02 14:33:19.011: D/InvitesObjectListAdapter(856): String to be converted is 2015-08-03 10:30:00 08-02 14:33:19.041: W/System.err(856): java.io.IOException: Resource not found: "org/joda/time/tz/data/ZoneInfoMap" ClassLoader: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/me.lunchbunch.core-1/base.apk"],nativeLibraryDirectories=[/vendor/lib64, /system/lib64]]]
有人知道这个错误是从哪里来的吗?
抱歉浪费了人们的时间,@adelphus 是正确的 - 我没有初始化:
JodaTimeAndroid.init(this);
它在我的代码中,但我需要重构以确保它被命中。