+ // Update the bookmark name, URL, parent folder, display order, and favorite icon.
+ public void updateBookmark(int databaseId, String bookmarkName, String bookmarkUrl, String parentFolder, int displayOrder, byte[] favoriteIcon) {
+ // Initialize a `ContentValues`.
+ ContentValues bookmarkContentValues = new ContentValues();
+
+ // Store the updated values.
+ bookmarkContentValues.put(BOOKMARK_NAME, bookmarkName);
+ bookmarkContentValues.put(BOOKMARK_URL, bookmarkUrl);
+ bookmarkContentValues.put(PARENT_FOLDER, parentFolder);
+ bookmarkContentValues.put(DISPLAY_ORDER, displayOrder);
+ bookmarkContentValues.put(FAVORITE_ICON, favoriteIcon);
+
+ // Get a writable database handle.
+ SQLiteDatabase bookmarksDatabase = this.getWritableDatabase();
+
+ // Update the bookmark. The last argument is `null` because there are no `whereArgs`.
+ bookmarksDatabase.update(BOOKMARKS_TABLE, bookmarkContentValues, _ID + " = " + databaseId, null);
+
+ // Close the database handle.
+ bookmarksDatabase.close();
+ }
+
+ // Update the folder name.