https://kotlinlang.org logo
#android
Title
# android
i

iex

02/28/2020, 4:57 PM
How to deal with
activity
being optional in
onCreateDialog
?
Copy code
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog =
    DatePickerDialog(activity!!, this, initDate.year, initDate.month, initDate.day)
k

kevin.cianfarini

02/28/2020, 5:30 PM
requireActivity()
i

iex

02/28/2020, 5:40 PM
thanks!