Use getActivity()
instead of this ReminderFragment.this
. The first param is a context ReminderFragment.this
refers to the ReminderFragment
. getActivity()
returns the Activity this Fragment is associated with.
timePickerDialog = new TimePickerDialog(
getActivity(),
onTimeSetListener,
calendar.get(Calendar.HOUR_OF_DAY),
calendar.get(Calendar.MINUTE),
is24r);