	public int update(Uri uri, ContentValues values, String where,
			String[] whereArgs) {
		int count = 0;
		String podcastId;
		SharedPreferences prefs = getContext().getSharedPreferences("internals", Context.MODE_WORLD_READABLE);
		Long activePodcastId = prefs.getLong(PREF_ACTIVE, -1);
		switch (uriMatcher.match(uri)) {
		case PODCAST_ID:
			podcastId = uri.getLastPathSegment();
			break;
		case PODCASTS_ACTIVE:
			if (values.containsKey(COLUMN_ID)) {
				activePodcastId = values.getAsLong(COLUMN_ID);
				Editor editor = prefs.edit();
				if (activePodcastId != null)
					editor.putLong(PREF_ACTIVE, values.getAsLong(COLUMN_ID));
				else
					editor.remove(PREF_ACTIVE);
				editor.commit();
				if (activePodcastId == null || values.size() == 1)
					return 0;
			}
			if (activePodcastId == -1)
				return 0;
			podcastId = String.valueOf(activePodcastId);
			break;
		default:
			throw new IllegalArgumentException("Unknown URI");
		}
		String extraWhere = COLUMN_ID + " = " + podcastId;
		if (where != null)
			where = extraWhere + " AND " + where;
		else
			where = extraWhere;
		values.remove(COLUMN_SUBSCRIPTION_TITLE);
		if (values.containsKey(COLUMN_QUEUE_POSITION)) {
			Integer newPosition = values.getAsInteger(COLUMN_QUEUE_POSITION);
			values.remove(COLUMN_QUEUE_POSITION);
			updateQueuePosition(podcastId, newPosition);
		}
		SQLiteDatabase db = _dbAdapter.getWritableDatabase();
		if (values.size() > 0)
			count += db.update("podcasts", values, where, whereArgs);
		getContext().getContentResolver().notifyChange(Uri.withAppendedPath(URI, podcastId), null);
		if (values.containsKey(COLUMN_FILE_SIZE))
			getContext().getContentResolver().notifyChange(
					Uri.withAppendedPath(URI, "to_download"), null);
		if (podcastId.equals(activePodcastId))
			getContext().getContentResolver().notifyChange(
					Uri.withAppendedPath(URI, "active"), null);
		return count;
	}

	public int update(Uri uri, ContentValues values, String where,
			String[] whereArgs) {
		int count = 0;
		String podcastId;
		SharedPreferences prefs = getContext().getSharedPreferences("internals", Context.MODE_WORLD_READABLE);
		Long activePodcastId = prefs.getLong(PREF_ACTIVE, -1);
		switch (uriMatcher.match(uri)) {
		case PODCAST_ID:
			podcastId = uri.getLastPathSegment();
			break;
		case PODCASTS_ACTIVE:
			if (values.containsKey(COLUMN_ID)) {
				activePodcastId = values.getAsLong(COLUMN_ID);
				Editor editor = prefs.edit();
				if (activePodcastId != null)
					editor.putLong(PREF_ACTIVE, values.getAsLong(COLUMN_ID));
				else
					editor.remove(PREF_ACTIVE);
				editor.commit();
				if (activePodcastId == null || values.size() == 1)
					return 0;
			}
			if (activePodcastId == -1)
				return 0;
			podcastId = String.valueOf(activePodcastId);
			break;
		default:
			throw new IllegalArgumentException("Unknown URI");
		}
		String extraWhere = COLUMN_ID + " = " + podcastId;
		if (where != null)
			where = extraWhere + " AND " + where;
		else
			where = extraWhere;
		values.remove(COLUMN_SUBSCRIPTION_TITLE);
		if (values.containsKey(COLUMN_QUEUE_POSITION)) {
			Integer newPosition = values.getAsInteger(COLUMN_QUEUE_POSITION);
			values.remove(COLUMN_QUEUE_POSITION);
			updateQueuePosition(podcastId, newPosition);
		}
		SQLiteDatabase db = _dbAdapter.getWritableDatabase();
		if (values.size() > 0)
			count += db.update("podcasts", values, where, whereArgs);
		getContext().getContentResolver().notifyChange(Uri.withAppendedPath(URI, podcastId), null);
		if (values.containsKey(COLUMN_FILE_SIZE))
			getContext().getContentResolver().notifyChange(Uri.withAppendedPath(URI, "to_download"), null);
		if (new Long(podcastId).equals(activePodcastId))
			getContext().getContentResolver().notifyChange(Uri.withAppendedPath(URI, "active"), null);
		return count;
	}
