Android examples for java.util:Week
get First Day Of Week
import android.util.Log; import java.text.DateFormatSymbols; import java.util.ArrayList; import java.util.Arrays; import java.util.Calendar; import java.util.Collections; import java.util.Locale; public class Main{ private static final String LOG_TAG = CalendarUtil.class .getSimpleName();//from ww w .j a va 2 s. c o m public static Calendar getFirstDayOfWeek(final int weekOfYear, final int year) { Log.d(LOG_TAG, "getFirstDayOfWeek(final int weekOfYear, final int year) is called."); return getDayOfWeek(Calendar.getInstance(), Calendar.MONDAY, weekOfYear, year); } public static Calendar getDayOfWeek(final int dayOfWeek, final int weekOfYear, final int year) { Log.d(LOG_TAG, "getDayOfWeek(final int dayOfWeek, final int weekOfYear, final int year) is called."); return getDayOfWeek(Calendar.getInstance(), dayOfWeek, weekOfYear, year); } private static Calendar getDayOfWeek(final Calendar c, final int dayOfWeek, final int weekOfYear, final int year) { c.clear(); c.set(Calendar.YEAR, year); c.set(Calendar.WEEK_OF_YEAR, weekOfYear); c.set(Calendar.DAY_OF_WEEK, dayOfWeek); return c; } }