1

i need change my system date ( time ) after launch application , it is possible in android programmatically ?

Thank you

Redha Chemali
  • 87
  • 2
  • 9

1 Answers1

0

You need android.permission.SET_TIME. Use the AlarmManager via Context.getSystemService(Context.ALARM_SERVICE) method setTime().

Snippet:

Calendar cal = Calendar.getInstance();
cal.set(2014, 9, 29, 18, 19, 00);

AlarmManager am = (AlarmManager) this.getSystemService(Context.ALARM_SERVICE);
am.setTime(cal.getTimeInMillis());
Sagar Pilkhwal
  • 3,998
  • 2
  • 25
  • 77