DatePicker crash in samsung with android 5.0

柔情痞子 提交于 2019-11-30 06:03:45
kassim

As Ridcully says, its an issue with Samsung's 5.0 implementation

Workaround suggestions can be found here. Unfortunately none are the most pretty.

DatePicker crashes on my device when clicked (with personal app)

Forget about the built-in date picker. There's only one way to get rid of the crash: use a library that provides an independent implementation.

For a date picker fragment: https://github.com/flavienlaurent/datetimepicker

For a date picker widget: https://github.com/SingleCycleKing/CustomTimePicker (this is more a starting point than a ready-to-use-solution)

As alanv noticed, this is a bug of Samsung's Android 5 implementation.

I set up a different theme which shows the date picker with the (older) spinners instead of the calendar view. In the code, I check if the app is running on a samsung device with lollipop and a language other then english, and if so, I apply the theme with the spinners. This works well and there are no other libraries or other hacks necessary.

If needed I can add the theme and how to apply it to this answer.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!