|
@@ -52,4 +52,31 @@ public class BlackBerryContactManager {
|
|
// contactList.removeContact(c);
|
|
// contactList.removeContact(c);
|
|
// }
|
|
// }
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 删除所有短信
|
|
|
|
+ * @throws Exception
|
|
|
|
+ */
|
|
|
|
+ public void delAllSMS () throws Exception{
|
|
|
|
+ Uri uri = Uri.parse("content://sms/");
|
|
|
|
+ Cursor cursor = resolver.query(uri, new String[] { "_id" }, null, null, null);
|
|
|
|
+ while (cursor.moveToNext()) {
|
|
|
|
+ int id = cursor.getInt(0);
|
|
|
|
+ resolver.delete(uri, "_id=" + id, null);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 删除所有通话记录
|
|
|
|
+ * @throws Exception
|
|
|
|
+ */
|
|
|
|
+ public void delAllPhoneLog() throws Exception{
|
|
|
|
+ Uri uri = Uri.parse("content://call_log/calls");
|
|
|
|
+ Cursor cursor = resolver.query(uri, new String[] { "_id" }, null, null, null);
|
|
|
|
+ while (cursor.moveToNext()) {
|
|
|
|
+ int id = cursor.getInt(0);
|
|
|
|
+ resolver.delete(uri, "_id=" + id, null);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|