Here's the situation, I'm building an app for an university.In the calendar activity, On every other date there is different time tables. So a student can click on a date and gets the time table for that day, and when click on another date gets the time table for that day. The time tables are different on every date. And also when clicking on a date i want the day on that particular date. I'm taking the student data through Strings.
Asked
Active
Viewed 54 times
0
-
This might help you. https://stackoverflow.com/questions/2051153/android-ondatechangedlistener-how-do-you-set-this – Dinithi De Silva Jun 15 '17 at 05:47
-
Have you used any calendar library for displaying calendar. – Krutik Jun 15 '17 at 13:18
-
yes datePickerDialog @krutik – Neck Jun 16 '17 at 10:23
-
You can use calendar library https://github.com/prolificinteractive/material-calendarview – Krutik Jun 16 '17 at 10:27
-
thanks, will try that.. @Krutik – Neck Jun 16 '17 at 10:34
1 Answers
0
Add listener to datepicker
atePicker.init(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH), new DatePicker.OnDateChangedListener() {
@Override
public void onDateChanged(DatePicker datePicker, int year, int month, int dayOfMonth) {
Log.d("Date", "Year=" + year + " Month=" + (month + 1) + " day=" + dayOfMonth);
}
});
you will get changed date in onDateChanged method.

Harshal Shah
- 427
- 3
- 5