skedgo / DateTimeRangePicker

A date time range picker for android written in Kotlin
MIT License
505 stars 76 forks source link

Intent Error #6

Closed rajam1215 closed 7 years ago

rajam1215 commented 7 years ago

Caused by: java.lang.IllegalStateException: intent.extras must not be null at skedgo.datetimerangepicker.DateTimeRangePickerActivity.onCreate(DateTimeRangePickerActivity.kt:47)

This Error come When we use Intent in MainActivity java class for go in DateTimeRangePickerActivity kotlin class

thuytrinh commented 7 years ago

You must use newIntent() to create intent to launch DateTimeRangePickerActivity like in https://github.com/skedgo/DateTimeRangePicker#usage.

zakirhussain49 commented 7 years ago

Hi Rajam,

Put the below check in DateTimeRangePickerActivity

if (intent.extras != null) viewModel.handleArgs(intent.extras)

and after then put the below code in DateTimeRangePickerViewModel

internal var timeZone: TimeZone? = TimeZone.getTimeZone(KEY_TIME_ZONE)

rajam1215 commented 7 years ago

Ok, Very Thanks