Code example for Calendar

Methods: add, clone

0
	 */ 
	public final void setMonth(Calendar month) {
		if (mPager == null) {
			return; 
		} 
		Calendar cal1 = (Calendar) month.clone();
		Calendar cal2 = (Calendar) month.clone();
		Calendar cal3 = (Calendar) month.clone();
		int pagerPosition = mPager.getCurrentItem();
		CalendarMonthView view1 = (CalendarMonthView) pages.get((pagerPosition - 1) % pages.size());
		CalendarMonthView view2 = (CalendarMonthView) pages.get(pagerPosition % pages.size());
		CalendarMonthView view3 = (CalendarMonthView) pages.get((pagerPosition + 1) % pages.size());
 
		cal1.add(Calendar.MONTH, -1);
		cal2.add(Calendar.MONTH, 0);
		cal3.add(Calendar.MONTH, 1);
		view1.setMonth(cal1);
		view2.setMonth(cal2);
		view3.setMonth(cal3);
	} 
	 
	/** 
	 * @return month. 
	 */