1

I am trying to set the calendar for my application using :

Calendar c = Calendar.getInstance();
c.set(2010, 1, 1, 12, 00, 00);
AlarmManager am = (AlarmManager) this.getSystemService(Context.ALARM_SERVICE);
am.setTime(c.getTimeInMillis());

permission:

android.permission.SET_TIME_ZONE

getting exception: Neither user 10215 nor current process has android.permission.SET_TIME.

2 Answers2

0

It's very clear from your error message that your app doesn't have permission to change the system time.

Use this permission in the manifest.xml

 <permission android:name="android.permission.SET_TIME"
    android:protectionLevel="signature|system"/>

See the documentation here

Rohit5k2
  • 17,948
  • 8
  • 45
  • 57
0

add this in your manifest

  <permission android:name="android.permission.SET_TIME"
               android:protectionLevel="signature|system"
    />
Nitesh
  • 318
  • 3
  • 16