update System Date via SystemClock - Android android.os

Android examples for android.os:SystemClock

Description

update System Date via SystemClock

Demo Code

import java.util.Calendar;

import android.os.SystemClock;

public class Main {

  public static void updateSystemDate(Calendar c) {

    long when = c.getTimeInMillis();
    SystemClock.setCurrentTimeMillis(when);
  }// w w  w.j  av  a2s. c o m

}

Related Tutorials