Skip to content Skip to sidebar Skip to footer

How To Change The Date On Android, Programmatically?

background since it could be useful for testing of apps that need to run based on dates and time, it could be nice to create a widget/shortcut on the 'desktop' of android, and by a

Solution 1:

You don't need to root your device, just use following code,

startActivity(new Intent(android.provider.Settings.ACTION_DATE_SETTINGS));

The another way is by using SystemClock class's setCurrentTimeMillis(long millis) method.

Post a Comment for "How To Change The Date On Android, Programmatically?"