how can i use correct context in date picker in fragment

19 Views Asked by At

i am newbie in Kotlin.i think that happen Caused by context but i cant solve it

    class FragmentDatePicker : DialogFragment() {
    override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
        return super.onCreateDialog(savedInstanceState)
        val c = Calendar.getInstance()
        val year = c.get(Calendar.YEAR)
        val day = c.get(Calendar.DAY_OF_MONTH)
        val month = c.get(Calendar.MONTH)
        return DatePickerDialog(requireContext() , null , year , month ,
        day)
    }
}

class Fragment_UserDetail:
    val fm = [email protected]
           FragmentDatePicker(). show( fm, DIALOG_DATE)
0

There are 0 best solutions below