android - Motorola devices : org.threeten.bp.DateTimeException when parsing a date in ThreeTen -
i have weird behaviour on motorola devices localdatetime.now()
returning 0000-00-00t00:00:00.0
threetenabp.
the code follow:
@override protected void onresume() { super.onresume(); if (!textutils.isempty(timeout)) { localdatetime savedtime = localdatetime.parse(timeout, datetimeformatter.iso_date_time); if (localdatetime.now().isafter(savedtime)) { refresh() } } } @override protected void onpause() { super.onpause(); localdatetime currenttime = localdatetime.now().plus(duration.ofminutes(10)); timeout = currenttime.format(datetimeformatter.iso_date_time); }
only on these devices (only 3 motorola devices running 6.0):
i have crash:
fatal exception: java.lang.runtimeexception: unable resume activity {com.myapp/com.myapp.mainactivity}: org.threeten.bp.format.datetimeparseexception: text '0000-00-00t00:00:00.8' not parsed: invalid value monthofyear (valid values 1 - 12): 0 @ android.app.activitythread.performresumeactivity(activitythread.java:3121) @ android.app.activitythread.handleresumeactivity(activitythread.java:3152) @ android.app.activitythread$h.handlemessage(activitythread.java:1398) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:148) @ android.app.activitythread.main(activitythread.java:5443) @ java.lang.reflect.method.invoke(method.java) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:728) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:618) caused org.threeten.bp.format.datetimeparseexception: text '0000-00-00t00:00:00.8' not parsed: invalid value monthofyear (valid values 1 - 12): 0 @ org.threeten.bp.format.datetimeformatter.createerror(datetimeformatter.java:1559) @ org.threeten.bp.format.datetimeformatter.parse(datetimeformatter.java:1496) @ org.threeten.bp.localdatetime.parse(localdatetime.java:444) @ com.myapp.mainactivity.onresume(mainactivity.java:273) @ android.app.activity.performresume(activity.java:6344) @ android.app.activitythread.performresumeactivity(activitythread.java:3110) @ android.app.activitythread.handleresumeactivity(activitythread.java:3152) @ android.app.activitythread$h.handlemessage(activitythread.java:1398) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:148) @ android.app.activitythread.main(activitythread.java:5443) @ java.lang.reflect.method.invoke(method.java) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:728) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:618) caused org.threeten.bp.datetimeexception: invalid value monthofyear (valid values 1 - 12): 0 @ org.threeten.bp.temporal.valuerange.checkvalidvalue(valuerange.java:278) @ org.threeten.bp.temporal.chronofield.checkvalidvalue(chronofield.java:557) @ org.threeten.bp.localdate.of(localdate.java:237) @ org.threeten.bp.chrono.isochronology.resolvedate(isochronology.java:452) @ org.threeten.bp.format.datetimebuilder.mergedate(datetimebuilder.java:297) @ org.threeten.bp.format.datetimebuilder.resolve(datetimebuilder.java:206) @ org.threeten.bp.format.datetimeformatter.parse(datetimeformatter.java:1491) @ org.threeten.bp.localdatetime.parse(localdatetime.java:444) @ com.myapp.mainactivity.onpostresume(mainactivity.java:273) @ android.app.activity.performresume(activity.java:6344) @ android.app.activitythread.performresumeactivity(activitythread.java:3110) @ android.app.activitythread.handleresumeactivity(activitythread.java:3152) @ android.app.activitythread$h.handlemessage(activitythread.java:1398) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:148) @ android.app.activitythread.main(activitythread.java:5443) @ java.lang.reflect.method.invoke(method.java) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:728) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:618)
line 273 is:
localdatetime savedtime = localdatetime.parse(timeout, datetimeformatter.iso_date_time);
so localedatetime.now()
returning invalid date time , parsing fails.
the other interesting thing happened since beginning of january. has ever faced problem?
Comments
Post a Comment