View Single Post
  #18 (permalink)  
Old 03-28-2008, 05:08 AM
amansundar amansundar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 324
amansundar is on a distinguished road
Default Re: Android Tips and tricks

Deleting a Record

To delete a single record, call ContentResolver.delete() with the URI of a specific row, or call Cursor.deleteRow().

To delete multiple rows, call ContentResolver.delete() with the URI of the type of record to delete (for example, android.provider.Contacts.People.CONTENT_URI) and a SQL WHERE clause defining which rows to delete (Warning: be sure to include a valid WHERE clause if deleting a general type using ContentResolver.delete(), or else you risk deleting more records than you intended!).

Remember, whenever calling updating methods on the Cursor class, you must call commitUpdates() to send the changes to the database.
__________________
cheers
Aman
Reply With Quote