How to add Duration to LocalDateTime for API level lower than 26

后端 未结 2 1586
误落风尘
误落风尘 2021-01-12 15:40

I am developing an application for API level 19 (KitKat).

I have a LocalDateTime object and a Duration object. I need to add this Dur

相关标签:
2条回答
  • 2021-01-12 16:20

    Currently you can enable java.time in lower level apis by upgrading grade to 4.0.0. read more here.

    0 讨论(0)
  • 2021-01-12 16:35

    The bbb answer in the comments is correct.

    Currently the best option for android is ThreeTenABP. Jake Wharton explains why it's better to use this library rather than Joda-Time and ThreeTenBP in Android.

    0 讨论(0)
提交回复
热议问题