title: Delete all phone call logs programmatically
body: <p>I'm trying to make a method to delete all call logs with one click.
  Here is my code:</p>
  <pre><code>    private void deletePhoneCallLogs() {
      Cursor cursor = getContext().getContentResolver().query(CallLog.Calls.CONTENT_URI, null, null, null, null);
      while (cursor.moveToNext()) {
          long id = cursor.getLong(cursor.getColumnIndexOrThrow(CallLog.Calls._ID));
          Uri deleteUri = ContentUris.withAppendedId(CallLog.Calls.CONTENT_URI, id);
          getContext().getContentResolver().delete(deleteUri, null, null);
      }
      cursor.close();
  }
  </code></pre>
  <p>My manifest for the permissions :</p>
  <pre><code>&lt;uses-permission android:name=&quot;android.permission.WRITE_CALL_LOG&quot;&gt;&lt;/uses-permission&gt;
  &lt;uses-permission android:name=&quot;android.permission.READ_CALL_LOG&quot;&gt;&lt;/uses-permission&gt;
  </code></pre>
  <p>I have an error that I don't understand, which is this one:</p>
  <pre><code>    java.lang.UnsupportedOperationException: Cannot delete that URL: content://call_log/calls/922
      at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:172)
      at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:140)
      at android.content.ContentProviderProxy.delete(ContentProviderNative.java:553)
      at android.content.ContentResolver.delete(ContentResolver.java:1956)
      at com.example.testbackup.ui.dataset1.Dataset1Fragment.deletePhoneCallLogs(Dataset1Fragment.java:425)
      at com.example.testbackup.ui.dataset1.Dataset1Fragment.access$800(Dataset1Fragment.java:55)
      at com.example.testbackup.ui.dataset1.Dataset1Fragment$2.onClick(Dataset1Fragment.java:150)
      at android.view.View.performClick(View.java:7870)
      at android.widget.TextView.performClick(TextView.java:14970)
      at android.view.View.performClickInternal(View.java:7839)
      at android.view.View.access$3600(View.java:886)
      at android.view.View$PerformClick.run(View.java:29363)
      at android.os.Handler.handleCallback(Handler.java:883)
      at android.os.Handler.dispatchMessage(Handler.java:100)
      at android.os.Looper.loop(Looper.java:237)
      at android.app.ActivityThread.main(ActivityThread.java:7948)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1075)
  </code></pre>
  <p>Does anyone have the solution ?</p>