With:
Calendar cal = Calendar.getInstance();
cal.setFirstDayOfWeek(Calendar.MONDAY);
you just set Monday's integer value to 0, but I want to have Monday displayed as first day (at the left end, and Sunday at the right)
Change Calendar to start from Monday on AndroidOpen Google Calendar. Tap on the hamburger menu (3-vertical lines in the top left corner) and open Settings from the bottom. Open General. Tap Start of the week and select Monday.
monday.com's Calendar View allows you to see all of your project's tasks and activities by date. It's a great way to visualize your project in its entirety, and to see when tasks are due.
Use xml parameter android:firstDayOfWeek with value from Calendar. 2 - is Monday.
<CalendarView
android:id="@+id/calendarView1"
android:firstDayOfWeek="2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="157dp" />
Or you can specify it from code
CalendarView calendarView = findViewById(R.id.calendarView1);
calendarView.setFirstDayOfWeek(Calendar.MONDAY);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With