How to show only the current month in the Android calendar

Show only the Current month on the calendar View Android (or) Either disable the scroll view in the calendar view .......

The code to display the calendar I wrote

<CalendarView android:id="@+id/calendar" android:layout_width="match_parent" android:layout_height="match_parent" android:showWeekNumber="false" android:shownWeekCount="5" android:scrollbars="none"/> 

How can I show only the current month .....? Please help me guys, thanks at Adcance.

+7
source share
1 answer

In your class, you can show all the way to the end of the current month:

 //get month and get how many days in current month Calendar calendar = Calendar.getInstance(); int daysInMonth = calendar.getActualMaximum(Calendar.DAY_OF_MONTH); cal.setMaxDate(daysInMonth); 

I do not believe your android:scrollbars="none" doing something for you.

You can also try something like one .

+1
source

All Articles