title: Delete SMS with contentResolver is too slow
body: <p>I would like to delete all SMS on my phone except the 500 last SMS for each conversation.
  This is my code but it's very slow (take about 10 seconds to delete one SMS).
  How I can speed up this code : </p>
  
  <pre><code>    ContentResolver cr = getContentResolver();
      Uri uriConv = Uri.parse("content://sms/conversations");
      Uri uriSms = Uri.parse("content://sms/");
      Cursor cConv = cr.query(uriConv, 
              new String[]{"thread_id"}, null, null, null);
  
      while(cConv.moveToNext()) {
          Cursor cSms = cr.query(uriSms, 
                  null,
                  "thread_id = " + cConv.getInt(cConv.getColumnIndex("thread_id")),
                  null, "date ASC");
          int count = cSms.getCount();
          for(int i = 0; i &lt; count - 500; ++i) {
              if (cSms.moveToNext()) {
                  cr.delete(
                          Uri.parse("content://sms/" + cSms.getInt(0)), 
                          null, null);
              }
          }
          cSms.close();
      }
      cConv.close();
  </code></pre>