get Next Alarm Date For Day - Android android.app

Android examples for android.app:AlarmManager

Description

get Next Alarm Date For Day

Demo Code

public class Main {

  private static final long DAY_MILLS = 1000 * 60 * 60 * 24;

  public static long getNextDateForDay(long startMills) {
    long currentMills = System.currentTimeMillis();
    long nextMills = startMills;
    while (currentMills > nextMills) {
      nextMills += DAY_MILLS;/*from   ww  w  .jav  a2s . co m*/
    }
    return nextMills;
  }

}

Related Tutorials