I use JodaTime in my application and I get reports from the developer console about crashes like this:
java.lang.RuntimeException: Unable to resume activity {com.myapp.app/Home}: java.lang.IllegalArgumentException: The datetime zone id 'Africa/Abuja' is not recognised
....
Caused by: java.lang.IllegalArgumentException: The datetime zone id 'Africa/Abuja' is not recognised
at org.joda.time.DateTimeZone.forTimeZone(DateTimeZone.java:337)
...
I use this line of code to get Timezone:
DateTimeZone tz = DateTimeZone.forTimeZone(TimeZone.getDefault());
Interestingly, most failures Africa/****.
TimeZone.getDefault() is part of the Android API, so I assumed that it will return the used timezone identifiers.
Is there anything I can do with these time zones to use them correctly? Is this a known issue with Android and Joda Time?
source
share