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
just use current year in this method:
int year = Calendar.getInstance().get(Calendar.YEAR); cal.set(Calendar.YEAR, year);
Leave rest the same as in your example.