Example usage for android.util MonthDisplayHelper MonthDisplayHelper

List of usage examples for android.util MonthDisplayHelper MonthDisplayHelper

Introduction

In this page you can find the example usage for android.util MonthDisplayHelper MonthDisplayHelper.

Prototype

public MonthDisplayHelper(int year, int month, int weekStartDay) 

Source Link

Usage

From source file:Main.java

/**
 * Get the number of rows for the provided month
 * @param year year//from  w  ww. ja va2s  .c  o  m
 * @param month month
 * @return number of rows
 */
public static int getNumOfRowsForTheMonth(int year, int month, int startDayOfTheWeek) {
    Calendar cal = Calendar.getInstance();
    cal.set(year, month, 1);
    MonthDisplayHelper displayHelper = new MonthDisplayHelper(year, month, startDayOfTheWeek);
    return displayHelper.getRowOf(cal.getActualMaximum(Calendar.DAY_OF_MONTH)) + 1;
}