get Day Of Week from android Time - Android java.util

Android examples for java.util:Week

Description

get Day Of Week from android Time

Demo Code


//package com.java2s;
import android.text.format.Time;

public class Main {
    public static int getDayOfWeek(Time time) {
        //original 0 - sunday, 1 - monday
        if (time.weekDay == 0) {
            return 6;
        } else {/*from ww  w .jav a2s. c o m*/
            return time.weekDay - 1;
        }
    }
}

Related Tutorials