Code example for ContentResolver

Methods: delete

0
	 * @param id The Media.Audio.Playlists id of the playlist. 
	 */ 
	public static void deletePlaylist(ContentResolver resolver, long id)
	{ 
		Uri uri = ContentUris.withAppendedId(MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI, id);
		resolver.delete(uri, null, null);
	} 
 
	/** 
	 * Rename the playlist with the given id. 
	 * 
	 * @param resolver A ContentResolver to use. 
	 * @param id The Media.Audio.Playlists id of the playlist. 
	 * @param newName The new name for the playlist. 
	 */ 
	public static void renamePlaylist(ContentResolver resolver, long id, String newName)
	{ 
		long existingId = getPlaylist(resolver, newName);
		// We are already called the requested name; nothing to do. 
		if (existingId == id)
			return;