get Alarm Interval For Mode - Android Android OS

Android examples for Android OS:Alarm Information

Description

get Alarm Interval For Mode

Demo Code


//package com.java2s;

public class Main {
    public static final int INTERVAL_DAILY = 1000 * 60 * 60 * 24;
    public static final int INTERVAL_WEEKLY = 1000 * 60 * 60 * 24 * 7;
    public static final int INTERVAL = 1000 * 30;

    public static int getIntervalForMode(int repeatMode) {
        int interval = INTERVAL_DAILY;
        if (repeatMode == 1) {
            interval = INTERVAL_DAILY;//from  ww w. j  av a 2 s .c o m
        } else if (repeatMode == 2) {
            interval = INTERVAL_WEEKLY;
        } else if (repeatMode == 100) {
            // this is for test, 30 second repeat
            interval = INTERVAL;
        }

        return interval;
    }
}

Related Tutorials