I use Android materialCalendar view library in one of my app,the user can select a particular date from the calendar view,i need to get the list of week days of that particular selected date .. i use the following code which retreives the current week days
daysList = new ArrayList<>();
Calendar cal = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("dd");
cal.setTime(day.getDate());
for (int i = 0; i < 7; i++) {
Log.i("dateTag", sdf.format(cal.getTime()));
daysList.add(sdf.format(cal.getTime()));
cal.add(Calendar.DAY_OF_WEEK, 1);
}
return daysList;
when i try to change the 3rd line of code to the user selected date, i get error as the selected date is type of materialcalendar view,how do i convert this selected date to java.util date
where day.getDate() is the user selected date from the widget...