- // Get a `Drawable` of the favorite icon from `mainWebView` and display it in `edit_bookmark_new_favorite_icon`.
- ImageView newFavoriteIcon = (ImageView) editBookmarkDialog.findViewById(R.id.edit_bookmark_new_favorite_icon);
- assert newFavoriteIcon != null; // Remove the warning below that `newFavoriteIcon` might be null.
- newFavoriteIcon.setImageBitmap(MainWebViewActivity.favoriteIcon);
+ // Get the current favorite icon byte array from the `Cursor`.
+ byte[] currentIconByteArray = bookmarkCursor.getBlob(bookmarkCursor.getColumnIndex(BookmarksDatabaseHandler.FAVORITE_ICON));
+ // Convert the byte array to a `Bitmap` beginning at the first byte and ending at the last.
+ Bitmap currentIconBitmap = BitmapFactory.decodeByteArray(currentIconByteArray, 0, currentIconByteArray.length);
+ // Display `currentIconBitmap` in `edit_bookmark_current_icon`.
+ ImageView currentIconImageView = (ImageView) alertDialog.findViewById(R.id.edit_bookmark_current_icon);
+ assert currentIconImageView != null; // Remove the warning below that `currentIconImageView` might be null;
+ currentIconImageView.setImageBitmap(currentIconBitmap);
+
+ // Get a `Bitmap` of the favorite icon from `MainWebViewActivity` and display it in `edit_bookmark_web_page_favorite_icon`.
+ ImageView newFavoriteIconImageView = (ImageView) alertDialog.findViewById(R.id.edit_bookmark_web_page_favorite_icon);
+ assert newFavoriteIconImageView != null; // Remove the warning below that `newFavoriteIcon` might be null.
+ newFavoriteIconImageView.setImageBitmap(MainWebViewActivity.favoriteIcon);