@Override public int delete(Uri uri, String where, String[] whereArgs) { SQLiteDatabase db = dbHelper.getWritableDatabase(); int count; int restId = getRestId(uri, where); switch (sUriMatcher.match(uri)) { case DEVICES: if (RESTMethod.delete(URL + "/devices/" + restId)) { count = db.delete(DEVICES_TABLE_NAME, where, whereArgs); } else { count = 0; } break; default: throw new IllegalArgumentException("Unknown URI " + uri); } getContext().getContentResolver().notifyChange(uri, null); return count; }