I want to call an asynctask on change of a date. So I am using the following code which is working fine. But some unexpected things are happening here.
CalendarView cv = (CalendarView) root.findViewById(R.id.calendarView1);
cv.setOnDateChangeListener(new CalendarView.OnDateChangeListener() {
@Override
public void onSelectedDayChange(CalendarView view, int year, int month,
int dayOfMonth) {
//Toast.makeText(getActivity(), mont + "/"+dayOfMonth + "/" + year, Toast.LENGTH_SHORT).show();
EventsTask gt = new EventsTask(getActivity(), eventsList);
gt.execute();
}
});
But this is also being called on change of month in calendar view which loads the same date. What needs to be done here so that I can stop this from happening.