Articles → ANDROID → CalendarView In Android

CalendarView In Android

What Is Calendarview?


  1. Display a calendar view
  2. On select of any date, display the selected date in the textbox.

Picture showing the calendar view and a textbox in an android application
Click to Enlarge

CalendarView dp = (CalendarView) findViewById(;

dp.setOnDateChangeListener(new CalendarView.OnDateChangeListener() {

    public void onSelectedDayChange(CalendarView view, int year, int month, int dayOfMonth) {
        TextView textView = (TextView) findViewById(;
        textView.setText(String.valueOf(year) +
            "-" + String.valueOf(month) + "-" + String.valueOf(dayOfMonth));

Picture showing the output of the calendar view control in android
Click to Enlarge

Posted By  -  Karan Gupta
Posted On  -  Sunday, November 24, 2019


Your Email Id  
Query/FeedbackCharacters remaining 250