unflagged.destination
unflagged.destination

Reputation: 1566

How to get previous and next month clickListener in MaterialCalanderView

I am using materialcalanderview to display calander. On click of previous and next month buttons (Swipe buttons) I have to do some operations. How can I get the clicklistener for these swipe buttons

Upvotes: 0

Views: 565

Answers (1)

unflagged.destination
unflagged.destination

Reputation: 1566

Got the solution. MonthChangeListener you can use. Putting a code snippet below

calendar.setOnMonthChangedListener(new OnMonthChangedListener() {
        @Override
        public void onMonthChanged(MaterialCalendarView widget, CalendarDay date) {
            Toast.makeText(getContext(),"Month Changed",Toast.LENGTH_LONG).show();
        }
    });

Upvotes: 1

Related Questions