i want to open a DatePickerDialog from an AppCompatDialog.
private fun pickDate() {
etProduktDatum.setOnClickListener {
getDateTimeCalendar()
DatePickerDialog(this,this,year,month,day).show()
}
}
When i try to create it, android studio complains that there is a Type mismatch on the first parameter of DatePickerDialog:
Type mismatch. Required: Contex Found: EinkaufslisteProduktgekauftDialog
This is my Dialog:
class EinkaufslisteProduktGekauftDialog (context: Context, var produkt : Produkt?, var addDialogListener: AddDialogListener) : AppCompatDialog(context), DatePickerDialog.OnDateSetListener{
var day = 0
var month = 0
var year = 0
var savedday = 0
var savedmonth = 0
var savedyear = 0