Android examples for java.util:Week
Get first day of week as android.text.format.Time constant.
import android.text.TextUtils; import android.text.format.Time; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.TimeZone; public class Main{ /**//from w ww .j ava2 s . c om * Get first day of week as android.text.format.Time constant. * * @return the first day of week in android.text.format.Time */ public static int getFirstDayOfWeek() { int startDay = Calendar.getInstance().getFirstDayOfWeek(); if (startDay == Calendar.SATURDAY) { return Time.SATURDAY; } else if (startDay == Calendar.MONDAY) { return Time.MONDAY; } else { return Time.SUNDAY; } } }