I have followed this article for creating a custom content provider http://xjaphx.wordpress.com/2011/06/19/create-and-use-custom-content-provider/. The problem I'm facing is with the URI and URIMatcher. I know we can urimatcher to match uri for a single item vs uri for list of items. But what If i dont use any uri matching concept eg I can write
CONTENT_URI is "pete.android.contentprovider"
String where = BaseColumns.COLUMN_ID + "?"
getContentResolver.delete(CONTENT_URI, where, new String[]{"2"})
The above query will delete the 2 row from the database table. If I can do this directly by using the where clause then why should I use switch case in delete function to determine whether the uri is for single item or multiple item.
What is the standard approach. I'm totally confused with this and cannot find a proper answer on any blog or forum.