答案 0 :(得分:0)
正确的代码语法是
“主页”选项卡的int week1 = calendar1.get(Calendar.WEEK_OF_YEAR);
int week2 = calendar2.get(Calendar.WEEK_OF_YEAR);
int calendarWeekDifference = (week2 - week1);
。
“服务”标签的public static int weeksTouched(Calendar fromDate, Calendar toDate){
DateTime fromDateTime = new DateTime(fromDate);
DateTime toDateTime = new DateTime(toDate);
DateTime epoch = new DateTime(0);
Weeks fromWeeks = Weeks.weeksBetween(epoch, fromDateTime);
Weeks toWeeks = Weeks.weeksBetween(epoch, toDateTime);
int betweenWeeks = toWeeks.getWeeks() - fromWeeks.getWeeks();
return betweenWeeks;
}
。
关于我们标签viewPager.setCurrentItem(0)
标签索引从0开始。
viewPager.setCurrentItem(1)