title: Android Calendar Check Permission
body: <p>I'm currently implementing the calendar provider however i've stumbled upon a minor error that i'd like to prevent.</p>
  
  <pre><code>ContentResolver contentResolver = getContentResolver();
  ContentValues contentValues = new ContentValues();
  
  ....
  
  Uri uri = contentResolver.insert(CalendarContract.Events.CONTENT_URI, contentValues); // Error pops here
  </code></pre>
  
  <p>"Call requires permission which may be rejected by user: code should explicitly check to see if permission is available (with <code>checkPermission</code>) or explicitly handle a potential `SecurityException"</p>
  
  <p>What is the best method to prevent this error?</p>
  
  <p>Any help will be appreciated.</p>