Android Week View (alamkanak - Library) Triplicates Event Names
Good afternoon guys. I have this problem, when i add some events to my calendar it triplicates the names of then. i tried changing the name, the time of the events, nothing worked.
Solution 1:
Please add below snippet in your code for display single event at a time
weekView.setMonthChangeListener(newMonthLoader.MonthChangeListener() {
@Overridepublic List<? extendsWeekViewEvent> onMonthChange(int newYear, int newMonth) {
if (newMonth == mainCalendar.get(Calendar.MONTH))
return events;
else {
returnnewArrayList<WeekViewEvent>();
}
}
});
Here I am checking by month . If particular event belong to that month , than only return event array otherwise return empty array :)
Happy coding.
Solution 2:
Propably it's late and you have figured it out since, but I put this here for anyone else.
The method onMonthChange(int newYear, int newMonth)
runs three time. Once for actual month, once for previous month and once for next month. Therefore you must return the events only for the year/month that you are supplied.
Post a Comment for "Android Week View (alamkanak - Library) Triplicates Event Names"