Code example for Uri

Methods: parseId

0
                        (!TextUtils.isEmpty(where) ?
                                " AND (" + where + ')' : ""),
                        whereArgs);
                break; 
            case VIDEO_ID:
                long videoId = ContentUris.parseId(uri);
                affected = db.delete(VIDEOS_TABLE_NAME,
                        BaseColumns._ID + "=" + videoId
                                + (!TextUtils.isEmpty(where) ?
                                " AND (" + where + ')' : ""),
                        whereArgs);
                getContext().getContentResolver().notifyChange(uri, null);
 
                break; 
            default: 
                throw new IllegalArgumentException("unknown video element: " +
                        uri);
        } 
 
        return affected;
    }