+ bookmarkContentValues.put(PARENT_FOLDER, newFolderName);
+
+ // SQL escape `oldFolderName`.
+ oldFolderName = DatabaseUtils.sqlEscapeString(oldFolderName);
+
+ // Run the update on all the bookmarks that currently list `oldFolderName` as their parent folder. The last argument is `null` because there are no `whereArgs`.
+ bookmarksDatabase.update(BOOKMARKS_TABLE, bookmarkContentValues, PARENT_FOLDER + " = " + oldFolderName, null);
+
+ // Close the database handle.
+ bookmarksDatabase.close();
+ }
+
+ // Update the folder icon.
+ public void updateFolder(int databaseId, byte[] folderIcon) {
+ // Get a writable database handle.
+ SQLiteDatabase bookmarksDatabase = this.getWritableDatabase();
+
+ // Store the updated icon in `folderContentValues`.
+ ContentValues folderContentValues = new ContentValues();
+ folderContentValues.put(FAVORITE_ICON, folderIcon);
+
+ // Run the update on the folder. The last argument is `null` because there are no `whereArgs`.
+ bookmarksDatabase.update(BOOKMARKS_TABLE, folderContentValues, _ID + " = " + databaseId, null);
+
+ // Close the database handle.
+ bookmarksDatabase.close();
+ }
+
+ // Update the folder name, parent folder, and display order.
+ public void updateFolder(int databaseId, String oldFolderName, String newFolderName, String parentFolder, int displayOrder) {
+ // Get a writable database handle.
+ SQLiteDatabase bookmarksDatabase = this.getWritableDatabase();