Require Help while writing Date Value to Parceable Class in android

前端 未结 1 800
Happy的楠姐
Happy的楠姐 2021-01-28 03:43

We\'re getting Null Pointer Exception while writing Date value to Parceable Class in Android.

We wanted to know what is the correct way to write Date Value to Parceable

相关标签:
1条回答
  • 2021-01-28 04:09
     private Date mDueDate = Calendar.getInstance().getTime();
    

    instead to serialize the Date object, get the long rapresenting the time in milliseconds and serialize that long. When you deserialize the object you can recreate the Date object

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