I got below code on stackoverflow which return total number of week in current year, but it is hardcoded which\'ll not work on 2014 and 2016. How I get total number of week
You can use the Calendar.getActualMaximum(int) method to get the total number of weeks in the current year as follows:
int totalNumberOfWeeks = Calendar.getInstance().getActualMaximum(Calendar.WEEK_OF_YEAR);
Simple.